Bug 964510 - Add delayed startup notifications for Fennec. r=mfinkle
authorWes Johnston <wjohnston@mozilla.com>
Tue, 28 Jan 2014 21:57:59 -0800
changeset 166443 b8c9dc39af31b0087ac5d95ddc43fbbf58df7ee8
parent 166442 5c5bdeec691845673737be429742458454cbed5e
child 166444 2c2c426e4afe7dd8205bf3aa54cce65eed096304
push id4778
push userwjohnston@mozilla.com
push dateSat, 01 Feb 2014 18:58:17 +0000
treeherderfx-team@ed28aeea074a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs964510
milestone29.0a1
Bug 964510 - Add delayed startup notifications for Fennec. r=mfinkle
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -282,16 +282,24 @@ var BrowserApp = {
 
   deck: null,
 
   startup: function startup() {
     window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess();
     dump("zerdatime " + Date.now() + " - browser chrome startup finished.");
 
     this.deck = document.getElementById("browsers");
+    this.deck.addEventListener("DOMContentLoaded", function BrowserApp_delayedStartup() {
+      try {
+        BrowserApp.deck.removeEventListener("DOMContentLoaded", BrowserApp_delayedStartup, false);
+        Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
+        sendMessageToJava({ type: "Gecko:DelayedStartup" });
+      } catch(ex) { console.log(ex); }
+    }, false);
+
     BrowserEventHandler.init();
     ViewportHandler.init();
 
     Services.androidBridge.browserApp = this;
 
     Services.obs.addObserver(this, "Locale:Changed", false);
     Services.obs.addObserver(this, "Tab:Load", false);
     Services.obs.addObserver(this, "Tab:Selected", false);