Bug 721220 - Send message back to java after tab selection is complete. r=mbrubeck
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Wed, 25 Jan 2012 20:06:08 -0800
changeset 85425 45207178a7350cf632e3bbf38c89ab1f8b8d873e
parent 85424 a89575b19f6c58f34161a81ba2c4f9ff1b60b9e6
child 85426 710c9b8252fb521ddf704ce290011dc8c6c75e3e
push id21921
push usermak77@bonardo.net
push dateThu, 26 Jan 2012 11:59:12 +0000
treeherdermozilla-central@f20f2b7c93cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs721220
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 721220 - Send message back to java after tab selection is complete. r=mbrubeck
mobile/android/base/gfx/GeckoSoftwareLayerClient.java
mobile/android/chrome/content/browser.js
--- a/mobile/android/base/gfx/GeckoSoftwareLayerClient.java
+++ b/mobile/android/base/gfx/GeckoSoftwareLayerClient.java
@@ -157,17 +157,17 @@ public class GeckoSoftwareLayerClient ex
         layerController.setRoot(mTileLayer);
         if (mGeckoViewport != null) {
             layerController.setViewportMetrics(mGeckoViewport);
         }
 
         GeckoAppShell.registerGeckoEventListener("Viewport:UpdateAndDraw", this);
         GeckoAppShell.registerGeckoEventListener("Viewport:UpdateLater", this);
         GeckoAppShell.registerGeckoEventListener("Document:Shown", this);
-        GeckoAppShell.registerGeckoEventListener("Tab:Selected", this);
+        GeckoAppShell.registerGeckoEventListener("Tab:Selected:Done", this);
 
         sendResizeEventIfNecessary();
     }
 
     private boolean setHasDirectTexture(boolean hasDirectTexture) {
         if (mTileLayer != null && hasDirectTexture == mHasDirectTexture)
             return false;
 
@@ -514,17 +514,17 @@ public class GeckoSoftwareLayerClient ex
             mUpdateViewportOnEndDraw = true;
 
             // Redraw everything.
             Rect rect = new Rect(0, 0, mBufferSize.width, mBufferSize.height);
             GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.DRAW, rect));
         } else if ("Viewport:UpdateLater".equals(event)) {
             mUpdateViewportOnEndDraw = true;
         } else if (("Document:Shown".equals(event) ||
-                    "Tab:Selected".equals(event)) &&
+                    "Tab:Selected:Done".equals(event)) &&
                    (mTileLayer instanceof MultiTileLayer)) {
             beginTransaction(mTileLayer);
             try {
                 ((MultiTileLayer)mTileLayer).invalidateTiles();
                 ((MultiTileLayer)mTileLayer).invalidateBuffer();
             } finally {
                 endTransaction(mTileLayer);
             }
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -534,16 +534,24 @@ var BrowserApp = {
   // in the Java UI.
   _handleTabSelected: function _handleTabSelected(aTab) {
       this.selectedTab = aTab;
       aTab.active = true;
 
       let evt = document.createEvent("UIEvents");
       evt.initUIEvent("TabSelect", true, false, window, null);
       aTab.browser.dispatchEvent(evt);
+
+    let message = {
+      gecko: {
+        type: "Tab:Selected:Done",
+        tabID: aTab.id
+      }
+    };
+    sendMessageToJava(message);
   },
 
   quit: function quit() {
     // Figure out if there's at least one other browser window around.
     let lastBrowser = true;
     let e = Services.wm.getEnumerator("navigator:browser");
     while (e.hasMoreElements() && lastBrowser) {
       let win = e.getNext();