Bug 716271 - Add "Tabs From Other Computers" to the Firefox button's History menu. r=dietrich

This commit is contained in:
Dão Gottwald 2012-01-14 12:28:45 +01:00
parent a64064f7b5
commit 20df52c6bb
3 changed files with 9 additions and 40 deletions

View File

@ -341,6 +341,13 @@
key="key_sanitize"
command="Tools:Sanitize"/>
<menuseparator class="hide-if-empty-places-result"/>
#ifdef MOZ_SERVICES_SYNC
<menuitem id="appmenu_sync-tabs"
class="syncTabsMenuItem"
label="&syncTabsMenu.label;"
oncommand="BrowserOpenSyncTabs();"
disabled="true"/>
#endif
<menuitem id="appmenu_restoreLastSession"
class="restoreLastSession"
label="&historyRestoreLastSession.label;"

View File

@ -90,16 +90,8 @@ let gSyncUI = {
Services.obs.addObserver(this, topic, true);
}, this);
// Find the alltabs-popup, only if there is a gBrowser
if (gBrowser) {
let popup = document.getElementById("alltabs-popup");
if (popup) {
popup.addEventListener(
"popupshowing", this.alltabsPopupShowing.bind(this), true);
}
if (Weave.Notifications.notifications.length)
this.initNotifications();
if (gBrowser && Weave.Notifications.notifications.length) {
this.initNotifications();
}
this.updateUI();
},
@ -149,34 +141,6 @@ let gSyncUI = {
button.removeAttribute("tooltiptext");
},
alltabsPopupShowing: function(event) {
// Should we show the menu item?
//XXXphilikon We should remove the check for isLoggedIn here and have
// about:sync-tabs auto-login (bug 583344)
if (!Weave.Service.isLoggedIn || !Weave.Engines.get("tabs").enabled)
return;
let label = this._stringBundle.GetStringFromName("tabs.fromOtherComputers.label");
let popup = document.getElementById("alltabs-popup");
if (!popup)
return;
let menuitem = document.createElement("menuitem");
menuitem.setAttribute("id", "sync-tabs-menuitem");
menuitem.setAttribute("label", label);
menuitem.setAttribute("class", "alltabs-item");
menuitem.setAttribute("oncommand", "BrowserOpenSyncTabs();");
// Fake the tab object on the menu entries, so that we don't have to worry
// about removing them ourselves. They will just get cleaned up by popup
// binding.
menuitem.tab = { "linkedBrowser": { "currentURI": { "spec": label } } };
let sep = document.getElementById("alltabs-popup-separator");
popup.insertBefore(menuitem, sep);
},
// Functions called by observers
onActivityStart: function SUI_onActivityStart() {

View File

@ -36,5 +36,3 @@ error.sync.quota.label = Server Quota Exceeded
error.sync.quota.description = Sync failed because it exceeded the server quota. Please review which data to sync.
error.sync.viewQuotaButton.label = View Quota
error.sync.viewQuotaButton.accesskey = V
tabs.fromOtherComputers.label = Tabs From Other Computers