Bug 1144780 - Replace gBrowser.selectedTab.linkedBrowser with gBrowser.selectedBrowser. r=dao
authorAbdelrhman Ahmed <a.ahmed1026@gmail.com>
Wed, 18 Mar 2015 11:25:00 +0100
changeset 263248 960b996d385c1a9603f452892eae9ac15aa68baa
parent 263247 59645225466f27afc00aade5f9299822cf33c942
child 263249 0b8c71d3aac061a4a76eafdff9e63de9996e56e0
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1144780
milestone39.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 1144780 - Replace gBrowser.selectedTab.linkedBrowser with gBrowser.selectedBrowser. r=dao
browser/base/content/browser-loop.js
browser/base/content/test/general/browser_autocomplete_enter_race.js
browser/components/loop/MozLoopAPI.jsm
browser/components/loop/test/mochitest/browser_mozLoop_sharingListeners.js
browser/devtools/responsivedesign/test/browser_responsive_cmd.js
--- a/browser/base/content/browser-loop.js
+++ b/browser/base/content/browser-loop.js
@@ -364,17 +364,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
         this._tabChangeListeners = new Set();
         gBrowser.addEventListener("select", this);
       }
 
       this._tabChangeListeners.add(listener);
       this._maybeShowBrowserSharingInfoBar();
 
       // Get the first window Id for the listener.
-      listener(null, gBrowser.selectedTab.linkedBrowser.outerWindowID);
+      listener(null, gBrowser.selectedBrowser.outerWindowID);
     },
 
     /**
      * Removes a listener from browser sharing.
      *
      * @param {Function} listener The listener to remove from the list.
      */
     removeBrowserSharingListener: function(listener) {
@@ -458,17 +458,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
     /**
      * Hides the infobar, permanantly if requested.
      *
      * @param {Boolean} permanently Flag that determines if the infobar will never
      *                              been shown again. Defaults to `false`.
      * @return {Boolean} |true| if the infobar was hidden here.
      */
     _hideBrowserSharingInfoBar: function(permanently = false, browser) {
-      browser = browser || gBrowser.selectedTab.linkedBrowser;
+      browser = browser || gBrowser.selectedBrowser;
       let box = gBrowser.getNotificationBox(browser);
       let notification = box.getNotificationWithValue(kBrowserSharingNotificationId);
       let removed = false;
       if (notification) {
         box.removeNotification(notification);
         removed = true;
       }
 
@@ -492,17 +492,17 @@ XPCOMUtils.defineLazyModuleGetter(this, 
       // Hide the infobar from the previous tab.
       if (event.fromTab) {
         wasVisible = this._hideBrowserSharingInfoBar(false, event.fromTab.linkedBrowser);
       }
 
       // We've changed the tab, so get the new window id.
       for (let listener of this._tabChangeListeners) {
         try {
-          listener(null, gBrowser.selectedTab.linkedBrowser.outerWindowID);
+          listener(null, gBrowser.selectedBrowser.outerWindowID);
         } catch (ex) {
           Cu.reportError("Tab switch caused an error: " + ex.message);
         }
       };
 
       if (wasVisible) {
         // If the infobar was visible before, we should show it again after the
         // switch.
--- a/browser/base/content/test/general/browser_autocomplete_enter_race.js
+++ b/browser/base/content/test/general/browser_autocomplete_enter_race.js
@@ -17,12 +17,12 @@ add_task(function*() {
   yield new Promise(resolve => waitForFocus(resolve, window));
 
   yield promiseAutocompleteResultPopup("keyword bear");
   gURLBar.focus();
   EventUtils.synthesizeKey("d", {});
   EventUtils.synthesizeKey("VK_RETURN", {});
 
   yield promiseTabLoadEvent(gBrowser.selectedTab);
-  is(gBrowser.selectedTab.linkedBrowser.currentURI.spec,
+  is(gBrowser.selectedBrowser.currentURI.spec,
      "http://example.com/?q=beard",
      "Latest typed characters should have been used");
 });
--- a/browser/components/loop/MozLoopAPI.jsm
+++ b/browser/components/loop/MozLoopAPI.jsm
@@ -278,17 +278,17 @@ function injectLoopAPI(targetWindow) {
      *
      * @param {Function} listener The listener to handle the windowId changes.
      */
     addBrowserSharingListener: {
       enumerable: true,
       writable: true,
       value: function(listener) {
         let win = Services.wm.getMostRecentWindow("navigator:browser");
-        let browser = win && win.gBrowser.selectedTab.linkedBrowser;
+        let browser = win && win.gBrowser.selectedBrowser;
         if (!win || !browser) {
           // This may happen when an undocked conversation window is the only
           // window left.
           let err = new Error("No tabs available to share.");
           MozLoopService.log.error(err);
           listener(cloneValueInto(err, targetWindow));
           return;
         }
--- a/browser/components/loop/test/mochitest/browser_mozLoop_sharingListeners.js
+++ b/browser/components/loop/test/mochitest/browser_mozLoop_sharingListeners.js
@@ -137,17 +137,17 @@ add_task(function* test_infoBar() {
   yield promiseWindowIdReceivedNewTab();
   Assert.strictEqual(gBrowser.selectedTab, createdTabs[1],
     "The second tab created should be selected now");
 
   // Add one sharing listener, which should show the infobar.
   yield promiseWindowIdReceivedOnAdd(handlers[0]);
 
   let getInfoBar = function() {
-    let box = gBrowser.getNotificationBox(gBrowser.selectedTab.linkedBrowser);
+    let box = gBrowser.getNotificationBox(gBrowser.selectedBrowser);
     return box.getNotificationWithValue(kBrowserSharingNotificationId);
   };
 
   let testBarProps = function() {
     let bar = getInfoBar();
 
     // Start with some basic assertions for the bar.
     Assert.ok(bar, "The notification bar should be visible");
--- a/browser/devtools/responsivedesign/test/browser_responsive_cmd.js
+++ b/browser/devtools/responsivedesign/test/browser_responsive_cmd.js
@@ -5,17 +5,17 @@
 //
 // Whitelisting this test.
 // As part of bug 1077403, the leaking uncaught rejection should be fixed.
 //
 thisTestLeaksUncaughtRejectionsAndShouldBeFixed("destroy");
 
 function test() {
   function isOpen() {
-    return gBrowser.getBrowserContainer(gBrowser.selectedTab.linkedBrowser)
+    return gBrowser.getBrowserContainer(gBrowser.selectedBrowser)
                    .hasAttribute("responsivemode");
   }
 
   helpers.addTabWithToolbar("data:text/html;charset=utf-8,hi", function(options) {
     return helpers.audit(options, [
       {
         setup: "resize toggle",
         check: {