Bug 869617. Remove dropdown menu from start sections.r=mbrubeck
authorAllison Naaktgeboren <ally@mozilla.com>
Mon, 22 Jul 2013 10:43:12 -0700
changeset 152640 2798d3895d4d9ea0f1652d273d8dda7c1dc8bfa6
parent 152639 1d69e824c5573048ac62bbcc6a5a37c6c6e1bfff
child 152641 190563720411aced23463291a39cd5c70f50a647
push id382
push userakeybl@mozilla.com
push dateMon, 21 Oct 2013 21:47:13 +0000
treeherdermozilla-release@5f1868ee45cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs869617
milestone25.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 869617. Remove dropdown menu from start sections.r=mbrubeck
browser/metro/base/content/RemoteTabs.js
browser/metro/base/content/browser-ui.js
browser/metro/base/content/browser.xul
browser/metro/base/content/console.js
browser/metro/base/tests/mochitest/browser_remotetabs.js
browser/metro/theme/browser.css
--- a/browser/metro/base/content/RemoteTabs.js
+++ b/browser/metro/base/content/RemoteTabs.js
@@ -126,19 +126,18 @@ let RemoteTabsStartView = {
 let RemoteTabsPanelView = {
   _view: null,
 
   get _grid() { return document.getElementById("remotetabs-list"); },
   get visible() { return PanelUI.isPaneVisible("remotetabs-container"); },
 
   init: function init() {
     //decks are fragile, don't hide the tab panel(bad things happen), hide link in menu.
-    let menuEntry = document.getElementById("menuitem-remotetabs");
     let snappedEntry = document.getElementById("snappedRemoteTabsLabel");
-    let uiList = [menuEntry, snappedEntry];
+    let uiList = [snappedEntry];
     this._view = new RemoteTabsView(this._grid, uiList);
   },
 
   show: function show() {
     this._grid.arrangeItems();
   },
 
   uninit: function uninit() {
--- a/browser/metro/base/content/browser-ui.js
+++ b/browser/metro/base/content/browser-ui.js
@@ -1206,17 +1206,16 @@ var StartUI = {
         aEvent.stopPropagation();
         break;
     }
   }
 };
 
 var PanelUI = {
   get _panels() { return document.getElementById("panel-items"); },
-  get _switcher() { return document.getElementById("panel-view-switcher"); },
 
   get isVisible() {
     return !Elements.panelUI.hidden;
   },
 
   views: {
     "bookmarks-container": "BookmarksPanelView",
     "console-container": "ConsolePanelView",
@@ -1254,17 +1253,16 @@ var PanelUI = {
   switchPane: function switchPane(aPanelId) {
     BrowserUI.blurFocusedElement();
 
     let panel = aPanelId ? document.getElementById(aPanelId) : this._panels.selectedPanel;
     let oldPanel = this._panels.selectedPanel;
 
     if (oldPanel != panel) {
       this._panels.selectedPanel = panel;
-      this._switcher.value = panel.id;
 
       this._fire("ToolPanelHidden", oldPanel);
     }
 
     this._fire("ToolPanelShown", panel);
   },
 
   isPaneVisible: function isPaneVisible(aPanelId) {
--- a/browser/metro/base/content/browser.xul
+++ b/browser/metro/base/content/browser.xul
@@ -297,25 +297,16 @@
           <toolbarbutton id="menu-button" class="appbar-primary" oncommand="Appbar.onMenuButton(event)"/>
         </toolbar>
       </vbox>
     </appbar>
 
     <vbox id="panel-container" hidden="true" class="window-width window-height meta" observes="bcast_windowState">
       <hbox id="panel-header">
         <toolbarbutton id="panel-close-button" command="cmd_panel"/>
-
-        <menulist id="panel-view-switcher" oncommand="PanelUI.switchPane(this.value);">
-          <menupopup>
-            <menuitem label="&bookmarksHeader.label;" value="bookmarks-container" id="menuitem-bookmarks"/>
-            <menuitem label="&startHistoryHeader.label;" value="history-container" id="menuitem-history"/>
-            <menuitem label="&startRemoteTabsHeader.label;" value="remotetabs-container" id="menuitem-remotetabs"/>
-            <menuitem label="&consoleHeader.label;" value="console-container" id="menuitem-console"/>
-          </menupopup>
-        </menulist>
       </hbox>
 
       <deck id="panel-items" selectedIndex="0" flex="1" >
         <scrollbox id="bookmarks-container" flex="1">
           <richgrid id="bookmarks-list" noun="bookmark" class="canSnapTiles" seltype="multiple" flex="1"/>
         </scrollbox>
         <scrollbox id="history-container" flex="1">
           <richgrid id="history-list" noun="history" class="canSnapTiles" seltype="multiple" flex="1"/>
--- a/browser/metro/base/content/console.js
+++ b/browser/metro/base/content/console.js
@@ -28,17 +28,16 @@ let ConsolePanelView = {
       // update users using the legacy pref
       if (Services.prefs.getBoolPref("browser.console.showInPanel")) {
         Services.prefs.setBoolPref(this._enabledPref, true);
         Services.prefs.clearUserPref("browser.console.showInPanel");
       }
     } catch(ex) {
       // likely don't have an old pref
     }
-    this.updateVisibility();
     Services.prefs.addObserver(this._enabledPref, this, false);
   },
 
   show: function show() {
     if (this._inited)
       return;
     this._inited = true;
 
@@ -63,24 +62,20 @@ let ConsolePanelView = {
 
     Services.prefs.removeObserver(this._enabledPref, this, false);
   },
 
   get enabled() {
     return Services.prefs.getBoolPref(this._enabledPref);
   },
 
-  updateVisibility: function ec_updateVisibility(aVal, aPref) {
-    let button = document.getElementById("menuitem-console");
-    button.hidden = !this.enabled;
-  },
-
   observe: function(aSubject, aTopic, aData) {
-    if (aTopic == "nsPref:changed")
-      this.updateVisibility();
+    if (aTopic == "nsPref:changed") {
+      // We may choose to create a new menu in v2
+      }
     else
       this.appendItem(aSubject);
   },
 
   showChromeErrors: function() {
     if (this._showChromeErrors != -1)
       return this._showChromeErrors;
 
--- a/browser/metro/base/tests/mochitest/browser_remotetabs.js
+++ b/browser/metro/base/tests/mochitest/browser_remotetabs.js
@@ -25,24 +25,19 @@ gTests.push({
     yield waitForCondition(() => StartUI.isStartPageVisible);
     yield hideContextUI();
 
     is(Weave.Status.checkSetup(), Weave.CLIENT_NOT_CONFIGURED, "Sync should be disabled on start");
 
     let vbox = document.getElementById("start-remotetabs");
     ok(vbox.hidden, "remote tabs in the start page should be hidden when sync is not enabled");
 
-    // check container link is hidden
-    let menulink = document.getElementById("menuitem-remotetabs");
-    ok(menulink.hidden, "link to container should be hidden when sync is not enabled");
-
     RemoteTabsStartView._view.setUIAccessVisible(true);
 
     // start page grid should be visible
     ok(vbox, "remote tabs grid is present on start page");
     is(vbox.hidden, false, "remote tabs should be visible in start page when sync is enabled");
 
     RemoteTabsStartView._view.setUIAccessVisible(false);
 
     ok(vbox.hidden, "remote tabs in the start page should be hidden when sync is not enabled");
-    ok(menulink.hidden, "link to container should be hidden when sync is not enabled");
   }
 });
--- a/browser/metro/theme/browser.css
+++ b/browser/metro/theme/browser.css
@@ -821,30 +821,16 @@ setting[type="radio"] > vbox {
     width: 40px;
   }
 }
 
 #panel-close-button[disabled] {
   opacity: .5;
 }
 
-#panel-view-switcher {
-  border: 0 none !important;
-  color: #000 !important;
-  background: transparent;
-  padding: 0;
-  font-size: @metro_font_xlarge@;
-  font-weight: 100;
-  margin: 0;
-}
-
-#panel-container[viewstate="snapped"] #panel-view-switcher {
-  font-size: @metro_font_large@;
-}
-
 #panel-items {
   padding-top: 20px;
   -moz-padding-start: 88px;
 }
 
 #panel-container[viewstate="snapped"] #panel-items {
   padding-left: 0px;
 }