backout c0bf8f743419 CLOSED TREE
authorWes Johnston <wjohnston@mozilla.com>
Thu, 23 Aug 2012 13:05:54 -0700
changeset 105252 bb414dc59262f90ea68031b6e0034ff952e56c03
parent 105251 e53c5799835032cc436209da3194d3b43474d524
child 105253 ecd18a2ed3ef0b67bdbc72445f7dd70021a6645e
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
milestone17.0a1
backs outc0bf8f74341984843682b8c0eeb1518deebc540d
backout c0bf8f743419 CLOSED TREE
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -316,28 +316,18 @@ var BrowserApp = {
       this.addTab(url, loadParams);
 
       // show telemetry door hanger if we aren't restoring a session
 #ifdef MOZ_TELEMETRY_REPORTING
       Telemetry.prompt();
 #endif
     }
 
-    if (updated) {
-        // creating the form history and passwords databases can be expensive
-        // delay it until after the first page has loaded
-        let browser = BrowserApp.selectedTab.browser;
-        let updatedFun = function updatedFun() {
-            browser.removeEventListener("DOMContentLoaded", updatedFun, false);
-            // initialize the form history and passwords databases on upgrades
-            Services.obs.notifyObservers(null, "FormHistory:Init", "");
-            Services.obs.notifyObservers(null, "Passwords:Init", "");
-        }
-        browser.addEventListener("DOMContentLoaded", updatedFun, false);
-    }
+    if (updated)
+      this.onAppUpdated();
 
     // notify java that gecko has loaded
     sendMessageToJava({
       gecko: {
         type: "Gecko:Ready"
       }
     });
 
@@ -480,16 +470,22 @@ var BrowserApp = {
         } catch(ex) {
            contentDisposition = "";
            type = "";
         }
         ContentAreaUtils.internalSave(aTarget.currentURI.spec, null, null, contentDisposition, type, false, "SaveImageTitle", null, aTarget.ownerDocument.documentURIObject, true, null);
       });
   },
 
+  onAppUpdated: function() {
+    // initialize the form history and passwords databases on upgrades
+    Services.obs.notifyObservers(null, "FormHistory:Init", "");
+    Services.obs.notifyObservers(null, "Passwords:Init", "");
+  },
+
   shutdown: function shutdown() {
     NativeWindow.uninit();
     SelectionHandler.uninit();
     FormAssistant.uninit();
     FindHelper.uninit();
     OfflineApps.uninit();
     IndexedDB.uninit();
     ViewportHandler.uninit();