Bug 895921 - Defect - Tab bar not appearing when selecting links from flyouts.r=?
authorAllison Naaktgeboren <ally@mozilla.com>
Wed, 07 Aug 2013 10:29:40 -0700
changeset 155494 85c1aed7e525f5dad8d52775e203f099ea2c72ed
parent 155493 3c188512a17c71e33b1c2eaa47ecb760b8ba00ab
child 155495 f8879459be3549eb139cabf78c58ffbb99c228e9
push id407
push userlsblakk@mozilla.com
push dateTue, 03 Dec 2013 03:32:50 +0000
treeherdermozilla-release@babf8c9ebc52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs895921
milestone26.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 895921 - Defect - Tab bar not appearing when selecting links from flyouts.r=?
browser/metro/base/content/browser-ui.js
browser/metro/base/content/browser.js
browser/metro/base/content/browser.xul
--- a/browser/metro/base/content/browser-ui.js
+++ b/browser/metro/base/content/browser-ui.js
@@ -406,22 +406,31 @@ var BrowserUI = {
       Browser.loadURI(submission.uri.spec, { postData: submission.postData });
 
       // loadURI may open a new tab, so get the selectedBrowser afterward.
       Browser.selectedBrowser.userTypedValue = submission.uri.spec;
       BrowserUI._titleChanged(Browser.selectedBrowser);
     });
   },
 
+  onAboutPolicyClick: function() {
+    FlyoutPanelsUI.hide();
+    let linkStr = Services.urlFormatter.formatURLPref("app.privacyURL");
+    BrowserUI.newTab(linkStr, Browser.selectedTab, true);
+  },
+
   /*********************************
    * Tab management
    */
 
-  newTab: function newTab(aURI, aOwner) {
+  newTab: function newTab(aURI, aOwner, aPeekTabs) {
     aURI = aURI || kStartOverlayURI;
+    if (aPeekTabs) {
+      ContextUI.peekTabs(kNewTabAnimationDelayMsec);
+    }
     let tab = Browser.addTab(aURI, true, aOwner);
     return tab;
   },
 
   setOnTabAnimationEnd: function setOnTabAnimationEnd(aCallback) {
     Elements.tabs.addEventListener("animationend", function onAnimationEnd() {
       Elements.tabs.removeEventListener("animationend", onAnimationEnd);
       aCallback();
@@ -1059,19 +1068,18 @@ var BrowserUI = {
       case "cmd_quit":
         // Only close one window
         this._closeOrQuit();
         break;
       case "cmd_close":
         this._closeOrQuit();
         break;
       case "cmd_newTab":
-        this.newTab();
+        this.newTab(null, null, true);
         this._edit.beginEditing(false);
-        ContextUI.peekTabs(kNewTabAnimationDelayMsec);
         break;
       case "cmd_closeTab":
         this.closeTab();
         break;
       case "cmd_undoCloseTab":
         this.undoCloseTab();
         break;
       case "cmd_sanitize":
@@ -1437,17 +1445,17 @@ var SettingsCharm = {
         label: Strings.browser.GetStringFromName("aboutCharm1"),
         onselected: function() FlyoutPanelsUI.show('AboutFlyoutPanel')
     });
     // Help
     this.addEntry({
         label: Strings.browser.GetStringFromName("helpOnlineCharm"),
         onselected: function() {
           let url = Services.urlFormatter.formatURLPref("app.support.baseURL");
-          BrowserUI.newTab(url, Browser.selectedTab);
+          BrowserUI.newTab(url, Browser.selectedTab, true);
         }
     });
   },
 
   observe: function SettingsCharm_observe(aSubject, aTopic, aData) {
     if (aTopic == "metro-settings-entry-selected") {
       let entry = this._entries.get(parseInt(aData, 10));
       if (entry)
--- a/browser/metro/base/content/browser.js
+++ b/browser/metro/base/content/browser.js
@@ -1034,23 +1034,16 @@ var Browser = {
           }
           if (SelectionHelperUI.canHandle(aMessage)) {
             SelectionHelperUI.openEditSession(aMessage);
           }
         }
         break;
     }
   },
-
-  onAboutPolicyClick: function() {
-    FlyoutPanelsUI.hide();
-    let linkStr = Services.urlFormatter.formatURLPref("app.privacyURL");
-    BrowserUI.newTab(linkStr, Browser.selectedTab);
-  }
-
 };
 
 Browser.MainDragger = function MainDragger() {
   this._horizontalScrollbar = document.getElementById("horizontal-scroller");
   this._verticalScrollbar = document.getElementById("vertical-scroller");
   this._scrollScales = { x: 0, y: 0 };
 
   Elements.browsers.addEventListener("PanBegin", this, false);
--- a/browser/metro/base/content/browser.xul
+++ b/browser/metro/base/content/browser.xul
@@ -460,17 +460,17 @@
 
 #if MOZ_UPDATE_CHANNEL != release
 #ifdef MOZ_UPDATER
       <description class="text-blurb" id="currentChannelText">&channel.description.start;<label id="currentChannel"/></description>
       <description class="text-blurb" id="currentChannelText2">&channel.description.end;</description>
 #endif
 #endif
       <label id="about-policy-label"
-            onclick="if (event.button == 0) { Browser.onAboutPolicyClick(); }"
+            onclick="if (event.button == 0) { BrowserUI.onAboutPolicyClick(); }"
             class="text-link" value="&aboutHeader.policy.label;"/>
     </flyoutpanel>
 
 #ifdef MOZ_SERVICES_SYNC
     <flyoutpanel id="sync-flyoutpanel" class="flyout-narrow" headertext="&sync.flyout.title;">
 
       <vbox id="sync-presetup-container" collapsed="true">
         <description>&sync.flyout.presetup.description1;</description>