diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp index ea335abc49a..823aa409f1e 100644 --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -397,6 +397,22 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait) break; } + case AndroidGeckoEvent::VIEWPORT: + case AndroidGeckoEvent::BROADCAST: { + + if (curEvent->Characters().Length() == 0) + break; + + nsCOMPtr obsServ = + mozilla::services::GetObserverService(); + + const NS_ConvertUTF16toUTF8 topic(curEvent->Characters()); + const nsPromiseFlatString& data = PromiseFlatString(curEvent->CharactersExtra()); + + obsServ->NotifyObservers(nsnull, topic.get(), data.get()); + break; + } + case AndroidGeckoEvent::LOAD_URI: { nsCOMPtr cmdline (do_CreateInstance("@mozilla.org/toolkit/command-line;1")); @@ -648,7 +664,6 @@ nsAppShell::PostEvent(AndroidGeckoEvent *ae) if (!allowCoalescingNextViewport) mQueuedViewportEvent = nsnull; } - NotifyNativeEvent(); } diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 20cc7485b0a..62e753455d8 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -82,7 +82,6 @@ using mozilla::unused; #include "imgIEncoder.h" #include "nsStringGlue.h" -#include "nsAutoPtr.h" using namespace mozilla; using namespace mozilla::widget; @@ -894,34 +893,6 @@ nsWindow::OnGlobalAndroidEvent(AndroidGeckoEvent *ae) win->mFocus->OnKeyEvent(ae); break; - case AndroidGeckoEvent::VIEWPORT: - case AndroidGeckoEvent::BROADCAST: { - if (ae->Characters().Length() == 0) - break; - - nsCOMPtr obsServ = - mozilla::services::GetObserverService(); - - const NS_ConvertUTF16toUTF8 topic(ae->Characters()); - const nsPromiseFlatString& data = PromiseFlatString(ae->CharactersExtra()); - - obsServ->NotifyObservers(nsnull, topic.get(), data.get()); - - if (ae->Type() == AndroidGeckoEvent::VIEWPORT) { - // We know that we've caused a complete invalidation - // and don't want to wait for the refresh driver - // to kick off a draw so we start one now. - // There are other smaller invalidations for touch hilighting that - // happen earlier so we don't necessarily want to have the - // refresh driver naively start a paint when we get the first - // invalidation. - nsIntRect rect(0, 0, win->mBounds.width, win->mBounds.height); - nsAutoPtr event(new AndroidGeckoEvent(AndroidGeckoEvent::DRAW, rect)); - win->OnDraw(event); - } - break; - } - case AndroidGeckoEvent::DRAW: layers::renderTraceEventStart("Global draw start", "414141"); win->OnDraw(ae);