Bug 1201331 (part 4) - replace "Tabs from other devices" with "Synced Tabs" on menus and history panel. r=Gijs

This commit is contained in:
Mark Hammond 2015-12-03 10:05:03 +11:00
parent 937d02b462
commit 13478de0d4
8 changed files with 24 additions and 23 deletions

View File

@ -367,9 +367,9 @@
<menuseparator id="sanitizeSeparator"/>
<menuitem id="sync-tabs-menuitem"
class="syncTabsMenuItem"
label="&syncTabsMenu2.label;"
label="&syncTabsMenu3.label;"
oncommand="BrowserOpenSyncTabs();"
disabled="true"/>
hidden="true"/>
<menuitem id="historyRestoreLastSession"
label="&historyRestoreLastSession.label;"
command="Browser:RestoreLastSession"/>

View File

@ -309,6 +309,23 @@ var gSyncUI = {
gFxAccounts.openSignInAgainPage(entryPoint);
},
openSyncedTabsPanel() {
let placement = CustomizableUI.getPlacementOfWidget("sync-button");
let area = placement ? placement.area : CustomizableUI.AREA_NAVBAR;
let anchor = document.getElementById("sync-button") ||
document.getElementById("PanelUI-menu-button");
if (area == CustomizableUI.AREA_PANEL) {
// The button is in the panel, so we need to show the panel UI, then our
// subview.
PanelUI.show().then(() => {
PanelUI.showSubView("PanelUI-remotetabs", anchor, area);
}).catch(Cu.reportError);
} else {
// It is placed somewhere else - just try and show it.
PanelUI.showSubView("PanelUI-remotetabs", anchor, area);
}
},
/* Update the tooltip for the sync-status broadcaster (which will update the
Sync Toolbar button and the Sync spinner in the FxA hamburger area.)
If Sync is configured, the tooltip is when the last sync occurred,

View File

@ -6471,7 +6471,7 @@ function isTabEmpty(aTab) {
}
function BrowserOpenSyncTabs() {
switchToTabHavingURI("about:sync-tabs", true);
gSyncUI.openSyncedTabsPanel();
}
/**

View File

@ -251,12 +251,6 @@ const CustomizableWidgets = [
tabsFromOtherComputers.setAttribute("hidden", true);
}
if (PlacesUIUtils.shouldEnableTabsFromOtherComputersMenuitem()) {
tabsFromOtherComputers.removeAttribute("disabled");
} else {
tabsFromOtherComputers.setAttribute("disabled", true);
}
let utils = RecentlyClosedTabsAndWindowsMenuUtils;
let tabsFragment = utils.getTabsFragment(doc.defaultView, "toolbarbutton", true,
"menuRestoreAllTabsSubview.label");

View File

@ -86,7 +86,7 @@
command="Tools:Sanitize"/>
<toolbarbutton id="sync-tabs-menuitem2"
class="syncTabsMenuItem subviewbutton"
label="&syncTabsMenu2.label;"
label="&syncTabsMenu3.label;"
oncommand="BrowserOpenSyncTabs();"
disabled="true"/>
<toolbarbutton id="appMenuRestoreLastSession"

View File

@ -1223,16 +1223,7 @@ this.PlacesUIUtils = {
shouldShowTabsFromOtherComputersMenuitem: function() {
let weaveOK = Weave.Status.checkSetup() != Weave.CLIENT_NOT_CONFIGURED &&
Weave.Svc.Prefs.get("firstSync", "") != "notReady";
let cloudSyncOK = CloudSync && CloudSync.ready && CloudSync().tabsReady && CloudSync().tabs.hasRemoteTabs();
return weaveOK || cloudSyncOK;
},
shouldEnableTabsFromOtherComputersMenuitem: function() {
let weaveEnabled = Weave.Service.isLoggedIn &&
Weave.Service.engineManager.get("tabs") &&
Weave.Service.engineManager.get("tabs").enabled;
let cloudSyncEnabled = CloudSync && CloudSync.ready && CloudSync().tabsReady && CloudSync().tabs.hasRemoteTabs();
return weaveEnabled || cloudSyncEnabled;
return weaveOK;
},
/**

View File

@ -2,7 +2,6 @@
- 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/. -->
<!-- LOCALIZATION NOTE (tabs.otherDevices.label): Keep this in sync with syncTabsMenu2.label from browser.dtd -->
<!ENTITY tabs.otherDevices.label "Tabs From Other Devices">
<!ENTITY tabs.searchText.label "Type here to find tabs…">

View File

@ -787,8 +787,8 @@ you can use these alternative items. Otherwise, their values should be empty. -
The word "toolbar" is appended automatically and should not be contained below! -->
<!ENTITY tabsToolbar.label "Browser tabs">
<!-- LOCALIZATION NOTE (syncTabsMenu2.label): This appears in the history menu -->
<!ENTITY syncTabsMenu2.label "Tabs From Other Devices">
<!-- LOCALIZATION NOTE (syncTabsMenu3.label): This appears in the history menu and history panel -->
<!ENTITY syncTabsMenu3.label "Synced Tabs">
<!ENTITY syncBrand.shortName.label "Sync">