Bug 860940 - Add static factory-style methods to create AndroidGeckoEvent instances in widget code. r=cpeterson

This commit is contained in:
Kartikaya Gupta
2013-04-17 17:39:12 -04:00
parent a56b5b95e4
commit 30b0f9b26e
5 changed files with 49 additions and 41 deletions

View File

@@ -514,7 +514,7 @@ nsWindow::IsEnabled() const
NS_IMETHODIMP
nsWindow::Invalidate(const nsIntRect &aRect)
{
AndroidGeckoEvent *event = new AndroidGeckoEvent(AndroidGeckoEvent::DRAW, aRect);
AndroidGeckoEvent *event = AndroidGeckoEvent::MakeDrawEvent(aRect);
nsAppShell::gAppShell->PostEvent(event);
return NS_OK;
}
@@ -2038,8 +2038,7 @@ nsWindow::SetInputContext(const InputContext& aContext,
if (mIMEUpdatingContext) {
return;
}
AndroidGeckoEvent *event = new AndroidGeckoEvent(
AndroidGeckoEvent::IME_EVENT,
AndroidGeckoEvent *event = AndroidGeckoEvent::MakeIMEEvent(
AndroidGeckoEvent::IME_UPDATE_CONTEXT);
nsAppShell::gAppShell->PostEvent(event);
mIMEUpdatingContext = true;
@@ -2068,8 +2067,8 @@ nsWindow::PostFlushIMEChanges()
// Already posted
return;
}
AndroidGeckoEvent *event = new AndroidGeckoEvent(
AndroidGeckoEvent::IME_EVENT, AndroidGeckoEvent::IME_FLUSH_CHANGES);
AndroidGeckoEvent *event = AndroidGeckoEvent::MakeIMEEvent(
AndroidGeckoEvent::IME_FLUSH_CHANGES);
nsAppShell::gAppShell->PostEvent(event);
}