Bug 1386594 - Remove XULBrowserWindow.init. r?johannh draft
authorDão Gottwald <dao@mozilla.com>
Wed, 02 Aug 2017 13:57:18 +0200
changeset 619684 5cd279d63882340e1a7f76096bd9379b274b5510
parent 619581 52285ea5e54c73d3ed824544cef2ee3f195f05e6
child 640484 939afb56ad4a1470a9571c767ddb386c2947f5b9
push id71772
push userdgottwald@mozilla.com
push dateWed, 02 Aug 2017 11:57:39 +0000
reviewersjohannh
bugs1386594
milestone57.0a1
Bug 1386594 - Remove XULBrowserWindow.init. r?johannh MozReview-Commit-ID: 6uWcb9FMdNE
browser/base/content/browser-customization.js
browser/base/content/browser.js
--- a/browser/base/content/browser-customization.js
+++ b/browser/base/content/browser-customization.js
@@ -59,17 +59,16 @@ var CustomizationHandler = {
   },
 
   _customizationEnding(aDetails) {
     // Update global UI elements that may have been added or removed
     if (aDetails.changed) {
       gURLBar = document.getElementById("urlbar");
 
       gHomeButton.updateTooltip();
-      XULBrowserWindow.init();
 
       if (AppConstants.platform != "macosx")
         updateEditUIVisibility();
 
       // Hacky: update the PopupNotifications' object's reference to the iconBox,
       // if it already exists, since it may have changed if the URL bar was
       // added/removed.
       if (!window.__lookupGetter__("PopupNotifications")) {
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1327,20 +1327,16 @@ var gBrowserInit = {
     ZoomUI.init(window);
 
     let mm = window.getGroupMessageManager("browsers");
     mm.loadFrameScript("chrome://browser/content/tab-content.js", true);
     mm.loadFrameScript("chrome://browser/content/content.js", true);
     mm.loadFrameScript("chrome://browser/content/content-UITour.js", true);
     mm.loadFrameScript("chrome://global/content/manifestMessages.js", true);
 
-    // initialize observers and listeners
-    // and give C++ access to gBrowser
-    XULBrowserWindow.init();
-
     window.messageManager.addMessageListener("Browser:LoadURI", RedirectLoad);
 
     if (!gMultiProcessBrowser) {
       // There is a Content:Click message manually sent from content.
       Cc["@mozilla.org/eventlistenerservice;1"]
         .getService(Ci.nsIEventListenerService)
         .addSystemEventListener(gBrowser, "click", contentAreaClick, true);
     }
@@ -4448,22 +4444,16 @@ var XULBrowserWindow = {
     delete this.isImage;
     return this.isImage = document.getElementById("isImage");
   },
   get canViewSource() {
     delete this.canViewSource;
     return this.canViewSource = document.getElementById("canViewSource");
   },
 
-  init() {
-    // Initialize the security button's state and tooltip text.
-    var securityUI = gBrowser.securityUI;
-    this.onSecurityChange(null, null, securityUI.state, true);
-  },
-
   setJSStatus() {
     // unsupported
   },
 
   forceInitialBrowserRemote(aRemoteType) {
     let initBrowser =
       document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
     gBrowser.updateBrowserRemoteness(initBrowser, true, { remoteType: aRemoteType });
@@ -7349,17 +7339,16 @@ var gIdentityHandler = {
   /**
    * This is called asynchronously when requested by the Logins module, after
    * the insecure login forms state for the page has been updated.
    */
   refreshForInsecureLoginForms() {
     // Check this._uri because we don't want to refresh the user interface if
     // this is called before the first page load in the window for any reason.
     if (!this._uri) {
-      Cu.reportError("Unexpected early call to refreshForInsecureLoginForms.");
       return;
     }
     this.refreshIdentityBlock();
   },
 
   updateSharingIndicator() {
     let tab = gBrowser.selectedTab;
     let sharing = tab.getAttribute("sharing");