Bug 873255 - Fx Metro: Remove option to always show tabs. r=mbrubeck
authorAllison Naaktgeboren <ally@mozilla.com>
Thu, 16 May 2013 17:43:57 -0700
changeset 139311 c2e9ea39d1047a406ce921a440172f6e3740b3a2
parent 139310 6b181afc9fadbd4bb9d04648aa24a34bd9731e82
child 139312 4d8e2a106e824c3c516ebf4a2030fd51ea9f43ea
push id3911
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 20:17:26 +0000
treeherdermozilla-aurora@7e26ca8db92b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs873255
milestone24.0a1
Bug 873255 - Fx Metro: Remove option to always show tabs. r=mbrubeck
browser/metro/base/content/ContentAreaObserver.js
browser/metro/base/content/browser-ui.js
browser/metro/base/content/browser.xul
browser/metro/locales/en-US/chrome/preferences.dtd
browser/metro/profile/metro.js
browser/metro/theme/browser.css
browser/metro/theme/defines.inc
browser/metro/theme/images/closetab-tab.png
browser/metro/theme/images/closetab-tabselected.png
browser/metro/theme/images/tab-selection-left.png
browser/metro/theme/images/tab-selection-right.png
browser/metro/theme/jar.mn
--- a/browser/metro/base/content/ContentAreaObserver.js
+++ b/browser/metro/base/content/ContentAreaObserver.js
@@ -285,18 +285,17 @@ var ContentAreaObserver = {
                        "content-height", "content-width",
                        "viewable-height", "viewable-width"]) {
       let index = stylesheet.insertRule("." + style + " {}", stylesheet.cssRules.length);
       this.styles[style] = stylesheet.cssRules[index].style;
     }
   },
 
   _getContentHeightForWindow: function (windowHeight) {
-    let contextUIHeight = BrowserUI.isTabsOnly ? Elements.toolbar.getBoundingClientRect().bottom : 0;
-    return windowHeight - contextUIHeight;
+    return windowHeight;
   },
 
   _getViewableHeightForContent: function (contentHeight) {
     let keyboardHeight = MetroUtils.keyboardHeight;
     return contentHeight - keyboardHeight;
   },
 
   _debugDumpDims: function _debugDumpDims() {
--- a/browser/metro/base/content/browser-ui.js
+++ b/browser/metro/base/content/browser-ui.js
@@ -91,17 +91,16 @@ var BrowserUI = {
     messageManager.addMessageListener("Content:StateChange", this);
 
     // listening escape to dismiss dialog on VK_ESCAPE
     window.addEventListener("keypress", this, true);
 
     window.addEventListener("MozPrecisePointer", this, true);
     window.addEventListener("MozImprecisePointer", this, true);
 
-    Services.prefs.addObserver("browser.tabs.tabsOnly", this, false);
     Services.prefs.addObserver("browser.cache.disk_cache_ssl", this, false);
     Services.obs.addObserver(this, "metro_viewstate_changed", false);
 
     // Init core UI modules
     ContextUI.init();
     StartUI.init();
     PanelUI.init();
     FlyoutPanelsUI.init();
@@ -138,17 +137,16 @@ var BrowserUI = {
 
       // Login Manager and Form History initialization
       Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
       Cc["@mozilla.org/satchel/form-history;1"].getService(Ci.nsIFormHistory2);
 
       messageManager.addMessageListener("Browser:MozApplicationManifest", OfflineApps);
 
       try {
-        BrowserUI._updateTabsOnly();
         Downloads.init();
         DialogUI.init();
         FormHelperUI.init();
         FindHelperUI.init();
         PdfJs.init();
 #ifdef MOZ_SERVICES_SYNC
         Sync.init();
 #endif
@@ -397,33 +395,28 @@ var BrowserUI = {
 
   closeTab: function closeTab(aTab) {
     // If no tab is passed in, assume the current tab
     let tab = aTab || Browser.selectedTab;
     Browser.closeTab(tab);
   },
 
   animateClosingTab: function animateClosingTab(tabToClose) {
-    if (this.isTabsOnly) {
-      Browser.closeTab(tabToClose, { forceClose: true } );
-    } else {
-      // Trigger closing animation
-      tabToClose.chromeTab.setAttribute("closing", "true");
+    tabToClose.chromeTab.setAttribute("closing", "true");
 
-      let wasCollapsed = !ContextUI.isExpanded;
-      if (wasCollapsed) {
-        ContextUI.displayTabs();
-      }
+    let wasCollapsed = !ContextUI.isExpanded;
+    if (wasCollapsed) {
+      ContextUI.displayTabs();
+    }
 
-      this.setOnTabAnimationEnd(function() {
-	Browser.closeTab(tabToClose, { forceClose: true } );
+    this.setOnTabAnimationEnd(function() {
+	    Browser.closeTab(tabToClose, { forceClose: true } );
         if (wasCollapsed)
           ContextUI.dismissWithDelay(kNewTabAnimationDelayMsec);
-      });
-    }
+    });
   },
 
   /**
     * Re-open a closed tab.
     * @param aIndex
     *        The index of the tab (via nsSessionStore.getClosedTabData)
     * @returns a reference to the reopened tab.
     */
@@ -520,42 +513,20 @@ var BrowserUI = {
   },
 
   // If the user types in the address bar, cancel pending
   // navbar autohide if set.
   navEditKeyPress: function navEditKeyPress() {
     ContextUI.cancelDismiss();
   },
 
-
-  /*********************************
-   * Conventional tabs
-   */
-
-  // Tabsonly displays the url bar with conventional tabs. Also
-  // the tray does not auto hide.
-  get isTabsOnly() {
-    return Services.prefs.getBoolPref("browser.tabs.tabsOnly");
-  },
-
-  _updateTabsOnly: function _updateTabsOnly() {
-    if (this.isTabsOnly) {
-      Elements.windowState.setAttribute("tabsonly", "true");
-    } else {
-      Elements.windowState.removeAttribute("tabsonly");
-    }
-  },
-
   observe: function BrowserUI_observe(aSubject, aTopic, aData) {
     switch (aTopic) {
       case "nsPref:changed":
         switch (aData) {
-          case "browser.tabs.tabsOnly":
-            this._updateTabsOnly();
-            break;
           case "browser.cache.disk_cache_ssl":
             this._sslDiskCacheEnabled = Services.prefs.getBoolPref(aData);
             break;
         }
         break;
       case "metro_viewstate_changed":
         this._adjustDOMforViewState();
         let autocomplete = document.getElementById("start-autocomplete");
@@ -1279,18 +1250,17 @@ var ContextUI = {
     }
 
     if (!setSilently)
       this._fire(aFlag ? "MozContextUIShow" : "MozContextUIDismiss");
   },
 
   // tab tray state
   _setIsExpanded: function _setIsExpanded(aFlag, setSilently) {
-    // if the tray can't be expanded because we're in
-    // tabsonly mode, don't expand it.
+    // if the tray can't be expanded, don't expand it.
     if (!this.isExpandable || this.isExpanded == aFlag)
       return;
 
     if (aFlag)
       Elements.tray.setAttribute("expanded", "true");
     else
       Elements.tray.removeAttribute("expanded");
 
--- a/browser/metro/base/content/browser.xul
+++ b/browser/metro/base/content/browser.xul
@@ -420,17 +420,16 @@
           <menulist id="prefs-homepage-options">
             <menupopup id="prefs-homepage-popup" position="after_end">
               <menuitem id="prefs-homepage-default" label="&optionsHeader.homepage.startPage.button;" value="false"/>
               <menuitem id="prefs-homepage-session" label="&optionsHeader.homepage.sessionRestore.button;" value="true"/>
             </menupopup>
           </menulist>
         </setting>
       </settings>
-      <setting pref="browser.tabs.tabsOnly" title="&optionsHeader.tabs.title;" type="bool"/>
       <settings id="prefs-charencoding" label="&optionsHeader.char.title;">
         <setting pref="browser.menu.showCharacterEncoding" title="&optionsHeader.char.options.label;" type="bool"/>
       </settings>
       <settings id="prefs-privdata" label="&clearPrivateData.title;">
         <description>&clearPrivateData.label;</description>
 
         <checkbox id="prefs-privdata-history" itemName="history" label="&clearPrivateData.history;" checked="true" />
 
--- a/browser/metro/locales/en-US/chrome/preferences.dtd
+++ b/browser/metro/locales/en-US/chrome/preferences.dtd
@@ -9,17 +9,16 @@
 <!ENTITY aboutHeader.policy.label                                "Read the &brandShortName; privacy policy online">
 
 <!-- ## Options Flyout Panel ## -->
 <!ENTITY optionsHeader.title                                     "Options">
 <!ENTITY optionsHeader.startup.title                             "Startup">
 <!ENTITY optionsHeader.homepage.title                            "When &brandShortName; starts, show">
 <!ENTITY optionsHeader.homepage.startPage.button                 "start page">
 <!ENTITY optionsHeader.homepage.sessionRestore.button            "tabs from last time">
-<!ENTITY optionsHeader.tabs.title                                "Always Show Tabs">
 <!ENTITY optionsHeader.char.title                                "Character Encoding">
 <!ENTITY optionsHeader.char.autodetect.label                     "Auto-detect">
 <!ENTITY optionsHeader.char.options.label                        "Show encoding options on the App Bar">
 
 <!ENTITY clearPrivateData.title                                  "Clear Private Data">
 <!ENTITY clearPrivateData.label                                  "Clear your browsing history, passwords, cookies, and form data on this device">
 <!ENTITY clearPrivateData.button                                 "Clear">
 <!ENTITY clearPrivateData.done                                   "Done!">
--- a/browser/metro/profile/metro.js
+++ b/browser/metro/profile/metro.js
@@ -46,22 +46,20 @@ pref("mousewheel.enable_pixel_scrolling"
 //
 pref("toolkit.browser.cacheRatioWidth", 2000);
 pref("toolkit.browser.cacheRatioHeight", 3000);
 
 // How long before a content view (a handle to a remote scrollable object)
 // expires.
 pref("toolkit.browser.contentViewExpire", 3000);
 
+
 pref("toolkit.defaultChromeURI", "chrome://browser/content/browser.xul");
 pref("browser.chromeURL", "chrome://browser/content/");
 
-// When true, always show the tab strip and use desktop-style tabs (no thumbnails)
-pref("browser.tabs.tabsOnly", false);
-
 pref("browser.tabs.remote", false);
 
 // Telemetry
 pref("toolkit.telemetry.enabled", true);
 pref("toolkit.telemetry.prompted", 2);
 
 pref("toolkit.screen.lock", false);
 
--- a/browser/metro/theme/browser.css
+++ b/browser/metro/theme/browser.css
@@ -43,19 +43,17 @@
 /* Sliding Toolbar/Tab Tray ------------------------------------------------- */
 
 #tray {
   transition: transform @metro_animation_duration@ @metro_animation_easing@;
   transform: translateY(-@tabs_height@);
   width: 100%;
 }
 
-/* in non-tabsonly mode the navigation bar and tab tray float over content. In
-   tabsonly mode they are always visible and offset content. */
-#tray:not([tabsonly]) {
+#tray {
   position: fixed;
 }
 
 #tray[visible][expanded]:not([viewstate="snapped"]) {
   transform: none;
 }
 
 /* Tabs --------------------------------------------------------------------- */
@@ -139,26 +137,26 @@
   }
 
   100% {
     opacity: 0;
     transform: scale(0, 0);
   }
 }
 
-#tray:not([tabsonly]) .documenttab-container {
+.documenttab-container {
   animation: open-documenttab 0.4s ease-out;
 }
 
-#tray:not([tabsonly]) documenttab[closing] > .documenttab-container {
+documenttab[closing] > .documenttab-container {
   animation: close-documenttab 0.4s ease-out;
   animation-fill-mode: forwards;
 }
 
-#tray:not([tabsonly]) .documenttab-favicon {
+.documenttab-favicon {
   visibility: collapse;
 }
 
 .documenttab-thumbnail {
   margin: @metro_spacing_normal@ @metro_spacing_snormal@;
   background: white none center top no-repeat;
   background-size: cover;
   width: @thumbnail_width@;
@@ -198,97 +196,16 @@ documenttab[selected] .documenttab-selec
   border-color: transparent !important;
   list-style-image: url("chrome://browser/skin/images/closetab-default.png");
 }
 
 .documenttab-close > .button-box > .button-text {
   display: none;
 }
 
-#tray[tabsonly] {
-  transform: none !important;
-}
-
-#tray[tabsonly] #tabs {
-  -moz-padding-start: @metro_spacing_small@;
-}
-
-#tray[tabsonly] #tabs-controls {
-  -moz-box-align: center;
-  -moz-box-orient: horizontal;
-  -moz-box-pack: end;
-  margin: 0;
-}
-
-#tray[tabsonly] #tabs-controls toolbarbutton {
-  margin-top: 0;
-  margin-bottom: 0;
-}
-
-#tray[tabsonly] documenttab {
-  height: @toolbar_height@;
-  margin: 0 -@tab_compression@;
-}
-
-#tray[tabsonly] documenttab:first-child {
-  -moz-margin-start: 0;
-}
-
-#tray[tabsonly] documenttab:last-child {
-  -moz-margin-end: 0;
-}
-
-#tray[tabsonly] .documenttab-thumbnail,
-#tray[tabsonly] .documenttab-selection,
-#tray[tabsonly] .documenttab-crop {
-  visibility: collapse;
-}
-
-#tray[tabsonly] .documenttab-container {
-  display: -moz-box;
-  -moz-box-orient: horizontal;
-  -moz-box-align: center;
-  padding: 0 @tab_spacing@;
-}
-
-#tray[tabsonly] .documenttab-favicon {
-  -moz-margin-start: @metro_spacing_normal@;
-  -moz-margin-end: @metro_spacing_snormal@;
-}
-
-#tray[tabsonly] .documenttab-title {
-  padding: 0;
-  margin: 0;
-  height: auto;
-  background: 0 none;
-  opacity: 1;
-  box-shadow: none;
-  width: @tab_inner_width@;
-}
-
-#tray[tabsonly] .documenttab-close {
-  list-style-image: url("chrome://browser/skin/images/closetab-tab.png");
-  position: relative;
-  padding: 0 !important;
-  z-index: 1;
-}
-
-#tray[tabsonly] documenttab[selected=true] {
-  background-color: @panel_light_color@;
-  background-image: url("chrome://browser/skin/images/tab-selection-left.png"),
-                    url("chrome://browser/skin/images/tab-selection-right.png"),
-                    @panel_light_background@;
-  background-position: left top, right top, center center;
-  background-repeat: no-repeat, no-repeat, repeat;
-}
-
-#tray[tabsonly] documenttab[selected=true] .documenttab-close {
-  list-style-image: url("chrome://browser/skin/images/closetab-tabselected.png");
-}
-
 #page,
 .selection-overlay {
   -moz-stack-sizing: ignore;
 }
 
 .selection-overlay {
   pointer-events: none;  
 }
@@ -296,20 +213,16 @@ documenttab[selected] .documenttab-selec
 .selection-overlay:-moz-focusring {
   outline: 0 !important;
 }
 
 .selection-overlay-hidden {
   display: none;
 }
 
-#tray[tabsonly] documenttab[selected=true] .documenttab-title {
-  color: #000;
-}
-
 #tabs-controls {
   margin-top: @metro_spacing_small@;
   -moz-box-align: start;
   -moz-box-orient: vertical;
   padding: 0 @metro_spacing_small@;
 }
 
 #tabs-controls toolbarbutton {
--- a/browser/metro/theme/defines.inc
+++ b/browser/metro/theme/defines.inc
@@ -18,105 +18,67 @@
 %define urlbar_edit_height 36px
 
 %define toolbar_vertical_spacing 5px
 %define toolbar_horizontal_spacing 20px
 %define toolbar_height 68px
 %define tabs_height 178px
 
 %define progress_height 5px
-%define progress_start_color #0095dd
-%define progress_end_color #97cbff
 
 %define metro_orange #FF8000
 
-%define label_height 30px
-
 %define thumbnail_width 232px
 %define thumbnail_height 148px
 
 %define tile_border_color #dbdcde
 %define tile_width 200px
 
-%define tab_inner_width 180px
-%define tab_spacing 45px;
-%define tab_compression 40px;
-
 %define scroller_thickness 4px
 %define scroller_minimum 8px
 
-%define metro_spacing_xxsmall 2px
 %define metro_spacing_xsmall 3px
 %define metro_spacing_small 5px
 %define metro_spacing_snormal 10px
 %define metro_spacing_normal 15px
 %define metro_spacing_xnormal 20px
 %define metro_spacing_xxnormal 25px
 %define metro_spacing_xxxnormal 30px
 %define metro_spacing_large 40px
-%define metro_spacing_xlarge 45px
 
 %define metro_border_thin 1px
 %define metro_border_thick 2px
 %define metro_border_xthick 4px
 
 %define metro_font_snormal 14px
 %define metro_font_normal 15px
 %define metro_font_large 25px
 %define metro_font_xlarge 45px
 
-%define font_xlarge 32px
-%define font_xnormal 17px
 %define font_normal 16px
 %define font_snormal 15px
 %define font_small 12px
 %define font_xsmall 11px
-%define font_tiny 9px
-%define font_xtiny 8px
-%define font_xxtiny 7px
 
 %define touch_row 47px
-%define touch_button_xlarge 48px
-%define touch_button_large 43px
 %define touch_button_small 37px
 %define touch_action_minwidth 133px
-%define touch_normal 43px
-%define touch_small 36px
 
-%define margin_context_popup 21px
 %define margin_large 16px
-%define margin_xxxnormal 11px
 %define margin_xnormal 7px
 %define margin_normal 5px
-%define margin_snormal 4px
-%define margin_small 3px
-%define margin_tiny 1px
-%define margin_xtiny 1px
 
-%define padding_xlarge 21px
-%define padding_large 16px
-%define padding_xxxnormal 11px
 %define padding_xxnormal 8px
 %define padding_xnormal 7px
 %define padding_normal 5px
-%define padding_snormal 4px
-%define padding_small 3px
-%define padding_xsmall 1px
-%define padding_tiny 1px
 
-%define border_width_xxlarge 4px
-%define border_width_xlarge 3px
 %define border_width_large 2px
 %define border_width_small 1px
 %define border_width_tiny 1px
 
 %define border_radius_normal 5px
-%define border_radius_small 4px
-%define border_radius_xsmall 2px
 %define border_radius_tiny 1px
 
-%define shadow_width_xlarge 7px
-%define shadow_width_large 4px
 %define shadow_width_small 1px
 
 % easing function and duration for animations match winJS showPanel method
 %define metro_animation_duration 550ms
 %define metro_animation_easing cubic-bezier(0.1, 0.9, 0.2, 1)
deleted file mode 100644
index 5561a1814c9b3c367ed6837658bd3319455f6136..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index bd35a2e2536da22c0b12ea2e9e0eef53021eb9ca..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index fc959e21a5a29d0d1a9d2e602be7a96da8282656..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 0a2c78129f02bc995759b1808d33a5f27526d77b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/browser/metro/theme/jar.mn
+++ b/browser/metro/theme/jar.mn
@@ -23,23 +23,19 @@ chrome.jar:
 
   skin/images/panel-light.png               (images/panel-light.png)
   skin/images/panel-dark.png                (images/panel-dark.png)
   skin/images/back.png                      (images/back.png)
   skin/images/forward.png                   (images/forward.png)
   skin/images/reload.png                    (images/reload.png)
   skin/images/newtab-default.png            (images/newtab-default.png)
   skin/images/closetab-default.png          (images/closetab-default.png)
-  skin/images/closetab-tab.png              (images/closetab-tab.png)
-  skin/images/closetab-tabselected.png      (images/closetab-tabselected.png)
   skin/images/tab-arrows.png                (images/tab-arrows.png)
   skin/images/tab-crop.png                  (images/tab-crop.png)
   skin/images/tab-overlay.png               (images/tab-overlay.png)
-  skin/images/tab-selection-left.png        (images/tab-selection-left.png)
-  skin/images/tab-selection-right.png       (images/tab-selection-right.png)
   skin/images/identity-icons-generic.png    (images/identity-icons-generic.png)
   skin/images/identity-icons-https-ev.png   (images/identity-icons-https-ev.png)
   skin/images/identity-icons-https-mixed.png  (images/identity-icons-https-mixed.png)
   skin/images/identity-icons-https.png      (images/identity-icons-https.png)
   skin/images/infobar-close.png             (images/infobar-close.png)
   skin/images/infobar-geolocation.png       (images/infobar-geolocation.png)
   skin/images/infobar-key.png               (images/infobar-key.png)
   skin/images/infobar-popup.png             (images/infobar-popup.png)