Bug 1241141 - remove Synced Tabs item from history panel. r=Gijs
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 01 Mar 2016 11:21:54 +1100
changeset 324285 1a61474707944169a43fddb94b3cf6da565df8dd
parent 324284 6c6528d0fd09f9ec7f2c8bb746a5e933b44ff8bf
child 324286 4247dcdafb2fe7c41933f4de3cce2ef5b44ec741
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1241141
milestone47.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 1241141 - remove Synced Tabs item from history panel. r=Gijs
browser/components/customizableui/CustomizableWidgets.jsm
browser/components/customizableui/content/panelUI.inc.xul
browser/components/customizableui/test/browser.ini
browser/components/customizableui/test/browser_946320_tabs_from_other_computers.js
browser/locales/en-US/chrome/browser/browser.dtd
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -241,23 +241,16 @@ const CustomizableWidgets = [
         recentlyClosedTabs.removeChild(recentlyClosedTabs.firstChild);
       }
 
       let recentlyClosedWindows = doc.getElementById("PanelUI-recentlyClosedWindows");
       while (recentlyClosedWindows.firstChild) {
         recentlyClosedWindows.removeChild(recentlyClosedWindows.firstChild);
       }
 
-      let tabsFromOtherComputers = doc.getElementById("sync-tabs-menuitem2");
-      if (PlacesUIUtils.shouldShowTabsFromOtherComputersMenuitem()) {
-        tabsFromOtherComputers.removeAttribute("hidden");
-      } else {
-        tabsFromOtherComputers.setAttribute("hidden", true);
-      }
-
       let utils = RecentlyClosedTabsAndWindowsMenuUtils;
       let tabsFragment = utils.getTabsFragment(doc.defaultView, "toolbarbutton", true,
                                                "menuRestoreAllTabsSubview.label");
       let separator = doc.getElementById("PanelUI-recentlyClosedTabs-separator");
       let elementCount = tabsFragment.childElementCount;
       separator.hidden = !elementCount;
       while (--elementCount >= 0) {
         tabsFragment.children[elementCount].classList.add("subviewbutton");
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -79,21 +79,16 @@
                        key="key_gotoHistory"
                        oncommand="SidebarUI.toggle('viewHistorySidebar'); PanelUI.hide();">
           <observes element="viewHistorySidebar" attribute="checked"/>
         </toolbarbutton>
         <toolbarbutton id="appMenuClearRecentHistory"
                        label="&appMenuHistory.clearRecent.label;"
                        class="subviewbutton"
                        command="Tools:Sanitize"/>
-        <toolbarbutton id="sync-tabs-menuitem2"
-                       class="syncTabsMenuItem subviewbutton"
-                       label="&syncTabsMenu3.label;"
-                       oncommand="BrowserOpenSyncTabs();"
-                       hidden="true"/>
         <toolbarbutton id="appMenuRestoreLastSession"
                        label="&appMenuHistory.restoreSession.label;"
                        class="subviewbutton"
                        command="Browser:RestoreLastSession"/>
         <menuseparator id="PanelUI-recentlyClosedTabs-separator"/>
         <vbox id="PanelUI-recentlyClosedTabs" tooltip="bhTooltip"/>
         <menuseparator id="PanelUI-recentlyClosedWindows-separator"/>
         <vbox id="PanelUI-recentlyClosedWindows" tooltip="bhTooltip"/>
--- a/browser/components/customizableui/test/browser.ini
+++ b/browser/components/customizableui/test/browser.ini
@@ -46,19 +46,16 @@ skip-if = os == "linux"
 
 # Bug 1163231 - Causes failures on Developer Edition on Windows 7.
 # [browser_932928_show_notice_when_palette_empty.js]
 
 [browser_934113_menubar_removable.js]
 # Because this test is about the menubar, it can't be run on mac
 skip-if = os == "mac"
 
-[browser_946320_tabs_from_other_computers.js]
-skip-if = os == "linux"
-
 [browser_934951_zoom_in_toolbar.js]
 [browser_938980_navbar_collapsed.js]
 [browser_938995_indefaultstate_nonremovable.js]
 [browser_940013_registerToolbarNode_calls_registerArea.js]
 [browser_940307_panel_click_closure_handling.js]
 [browser_940946_removable_from_navbar_customizemode.js]
 [browser_941083_invalidate_wrapper_cache_createWidget.js]
 [browser_942581_unregisterArea_keeps_placements.js]
deleted file mode 100644
--- a/browser/components/customizableui/test/browser_946320_tabs_from_other_computers.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-var Preferences = Cu.import("resource://gre/modules/Preferences.jsm", {}).Preferences;
-
-const {FxAccounts, AccountState} = Cu.import("resource://gre/modules/FxAccounts.jsm", {});
-
-// FxA logs can be gotten at via this pref which helps debugging.
-Preferences.set("services.sync.log.appender.dump", "Debug");
-
-add_task(function*() {
-  yield PanelUI.show({type: "command"});
-
-  let historyButton = document.getElementById("history-panelmenu");
-  let historySubview = document.getElementById("PanelUI-history");
-  let subviewShownPromise = subviewShown(historySubview);
-  historyButton.click();
-  yield subviewShownPromise;
-
-  let tabsFromOtherComputers = document.getElementById("sync-tabs-menuitem2");
-  is(tabsFromOtherComputers.hidden, true, "The Tabs From Other Computers menuitem should be hidden when sync isn't enabled.");
-
-  let hiddenPanelPromise = promisePanelHidden(window);
-  PanelUI.hide();
-  yield hiddenPanelPromise;
-
-  // Part 2 - When Sync is enabled the menuitem should be shown.
-  yield configureIdentity();
-  yield PanelUI.show({type: "command"});
-
-  subviewShownPromise = subviewShown(historySubview);
-  historyButton.click();
-  yield subviewShownPromise;
-
-  is(tabsFromOtherComputers.hidden, false, "The Tabs From Other Computers menuitem should be shown when sync is enabled.");
-
-  let syncPrefBranch = new Preferences("services.sync.");
-  syncPrefBranch.resetBranch("");
-  Services.logins.removeAllLogins();
-
-  hiddenPanelPromise = promisePanelHidden(window);
-  PanelUI.toggle({type: "command"});
-  yield hiddenPanelPromise;
-
-  yield fxAccounts.signOut(/*localOnly = */true);
-});
-
-function configureIdentity() {
-  // do the FxAccounts thang and wait for Sync to initialize the identity.
-  configureFxAccountIdentity();
-  return Weave.Service.identity.initializeWithCurrentIdentity().then(() => {
-    // need to wait until this identity manager is readyToAuthenticate.
-    return Weave.Service.identity.whenReadyToAuthenticate.promise;
-  });
-}
-
-// Configure an instance of an FxAccount identity provider.
-function configureFxAccountIdentity() {
-  // A mock "storage manager" for FxAccounts that doesn't actually write anywhere.
-  function MockFxaStorageManager() {
-  }
-
-  MockFxaStorageManager.prototype = {
-    promiseInitialized: Promise.resolve(),
-
-    initialize(accountData) {
-      this.accountData = accountData;
-    },
-
-    finalize() {
-      return Promise.resolve();
-    },
-
-    getAccountData() {
-      return Promise.resolve(this.accountData);
-    },
-
-    updateAccountData(updatedFields) {
-      for (let [name, value] of Iterator(updatedFields)) {
-        if (value == null) {
-          delete this.accountData[name];
-        } else {
-          this.accountData[name] = value;
-        }
-      }
-      return Promise.resolve();
-    },
-
-    deleteAccountData() {
-      this.accountData = null;
-      return Promise.resolve();
-    }
-  }
-
-  let user = {
-    assertion: "assertion",
-    email: "email",
-    kA: "kA",
-    kB: "kB",
-    sessionToken: "sessionToken",
-    uid: "user_uid",
-    verified: true,
-  };
-
-  let token = {
-    endpoint: null,
-    duration: 300,
-    id: "id",
-    key: "key",
-    // uid will be set to the username.
-  };
-
-  let MockInternal = {
-    newAccountState(credentials) {
-      isnot(credentials, "not expecting credentials");
-      let storageManager = new MockFxaStorageManager();
-      // and init storage with our user.
-      storageManager.initialize(user);
-      return new AccountState(storageManager);
-    },
-    _getAssertion(audience) {
-      return Promise.resolve("assertion");
-    },
-    getCertificateSigned() {
-      return Promise.resolve();
-    },
-  };
-  let mockTSC = { // TokenServerClient
-    getTokenFromBrowserIDAssertion: function(uri, assertion, cb) {
-      token.uid = "username";
-      cb(null, token);
-    },
-  };
-
-  let fxa = new FxAccounts(MockInternal);
-  Weave.Service.identity._fxaService = fxa;
-  Weave.Service.identity._tokenServerClient = mockTSC;
-  // Set the "account" of the browserId manager to be the "email" of the
-  // logged in user of the mockFXA service.
-  Weave.Service.identity._account = user.email;
-}
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -781,17 +781,17 @@ you can use these alternative items. Oth
 
 <!ENTITY identity.permissions "Permissions">
 <!ENTITY identity.permissionsEmpty "You have not granted this site any special permissions.">
 
 <!-- Name for the tabs toolbar as spoken by screen readers.
      The word "toolbar" is appended automatically and should not be contained below! -->
 <!ENTITY tabsToolbar.label "Browser tabs">
 
-<!-- LOCALIZATION NOTE (syncTabsMenu3.label): This appears in the history menu and history panel -->
+<!-- LOCALIZATION NOTE (syncTabsMenu3.label): This appears in the history menu -->
 <!ENTITY syncTabsMenu3.label     "Synced Tabs">
 
 <!ENTITY syncedTabs.sidebar.label              "Synced Tabs">
 <!ENTITY syncedTabs.sidebar.fetching.label     "Fetching Synced Tabs…">
 <!ENTITY syncedTabs.sidebar.noclients.label    "Sign in to Firefox from your other devices to view their tabs here.">
 <!ENTITY syncedTabs.sidebar.notsignedin.label  "Sign in to view a list of tabs from your other devices.">
 <!ENTITY syncedTabs.sidebar.notabs.label       "No open tabs">
 <!ENTITY syncedTabs.sidebar.openprefs.label    "Open &syncBrand.shortName.label; Preferences">