diff options
Diffstat (limited to 'application/basilisk/components/customizableui')
-rw-r--r-- | application/basilisk/components/customizableui/CustomizableWidgets.jsm | 73 | ||||
-rw-r--r-- | application/basilisk/components/customizableui/content/panelUI.inc.xul | 7 |
2 files changed, 4 insertions, 76 deletions
diff --git a/application/basilisk/components/customizableui/CustomizableWidgets.jsm b/application/basilisk/components/customizableui/CustomizableWidgets.jsm index 642e06f0f..09b3f167e 100644 --- a/application/basilisk/components/customizableui/CustomizableWidgets.jsm +++ b/application/basilisk/components/customizableui/CustomizableWidgets.jsm @@ -23,8 +23,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu", "resource://gre/modules/CharsetMenu.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "SyncedTabs", - "resource://services-sync/SyncedTabs.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService", "resource://gre/modules/ContextualIdentityService.jsm"); @@ -312,77 +310,6 @@ const CustomizableWidgets = [ obnode.setAttribute("element", "sync-status"); obnode.setAttribute("attribute", "syncstatus"); aNode.appendChild(obnode); - - // A somewhat complicated dance to format the mobilepromo label. - let bundle = doc.getElementById("bundle_browser"); - let formatArgs = ["android", "ios"].map(os => { - let link = doc.createElement("label"); - link.textContent = bundle.getString(`appMenuRemoteTabs.mobilePromo.${os}`); - link.setAttribute("mobile-promo-os", os); - link.className = "text-link remotetabs-promo-link"; - return link.outerHTML; - }); - let promoParentElt = doc.getElementById("PanelUI-remotetabs-mobile-promo"); - // Put it all together... - let contents = bundle.getFormattedString("appMenuRemoteTabs.mobilePromo.text2", formatArgs); - promoParentElt.innerHTML = contents; - // We manually manage the "click" event to open the promo links because - // allowing the "text-link" widget handle it has 2 problems: (1) it only - // supports button 0 and (2) it's tricky to intercept when it does the - // open and auto-close the panel. (1) can probably be fixed, but (2) is - // trickier without hard-coding here the knowledge of exactly what buttons - // it does support. - // So we allow left and middle clicks to open the link in a new tab and - // close the panel; not setting a "href" attribute prevents the text-link - // widget handling it, and we build the final URL in the click handler to - // make testing easier (ie, so tests can change the pref after the links - // were created and have the new pref value used.) - promoParentElt.addEventListener("click", e => { - let os = e.target.getAttribute("mobile-promo-os"); - if (!os || e.button > 1) { - return; - } - let link = Services.prefs.getCharPref(`identity.mobilepromo.${os}`) + "synced-tabs"; - doc.defaultView.openUILinkIn(link, "tab"); - CustomizableUI.hidePanelForNode(e.target); - }); - }, - onViewShowing(aEvent) { - let doc = aEvent.target.ownerDocument; - this._tabsList = doc.getElementById("PanelUI-remotetabs-tabslist"); - Services.obs.addObserver(this, SyncedTabs.TOPIC_TABS_CHANGED, false); - - if (SyncedTabs.isConfiguredToSyncTabs) { - if (SyncedTabs.hasSyncedThisSession) { - this.setDeckIndex(this.deckIndices.DECKINDEX_TABS); - } else { - // Sync hasn't synced tabs yet, so show the "fetching" panel. - this.setDeckIndex(this.deckIndices.DECKINDEX_FETCHING); - } - // force a background sync. - SyncedTabs.syncTabs().catch(ex => { - Cu.reportError(ex); - }); - // show the current list - it will be updated by our observer. - this._showTabs(); - } else { - // not configured to sync tabs, so no point updating the list. - this.setDeckIndex(this.deckIndices.DECKINDEX_TABSDISABLED); - } - }, - onViewHiding() { - Services.obs.removeObserver(this, SyncedTabs.TOPIC_TABS_CHANGED); - this._tabsList = null; - }, - _tabsList: null, - observe(subject, topic, data) { - switch (topic) { - case SyncedTabs.TOPIC_TABS_CHANGED: - this._showTabs(); - break; - default: - break; - } }, setDeckIndex(index) { let deck = this._tabsList.ownerDocument.getElementById("PanelUI-remotetabs-deck"); diff --git a/application/basilisk/components/customizableui/content/panelUI.inc.xul b/application/basilisk/components/customizableui/content/panelUI.inc.xul index e389b14bf..8ebd93327 100644 --- a/application/basilisk/components/customizableui/content/panelUI.inc.xul +++ b/application/basilisk/components/customizableui/content/panelUI.inc.xul @@ -23,10 +23,11 @@ <hbox id="PanelUI-footer-fxa"> <hbox id="PanelUI-fxa-status" defaultlabel="&fxaSignIn.label;" - signedinTooltiptext="&fxaSignedIn.tooltip;" - tooltiptext="&fxaSignedIn.tooltip;" + signedinTooltiptext="&syncSettings.label;" + tooltiptext="&syncSettings.label;" errorlabel="&fxaSignInError.label;" unverifiedlabel="&fxaUnverified.label;" + settingslabel="&syncSettings.label;" onclick="if (event.which == 1) gFxAccounts.onMenuPanelCommand();"> <image id="PanelUI-fxa-avatar"/> <toolbarbutton id="PanelUI-fxa-label" @@ -111,7 +112,7 @@ <vbox id="PanelUI-remotetabs-buttons"> <toolbarbutton id="PanelUI-remotetabs-view-sidebar" class="subviewbutton" - observes="viewTabsSidebar" + oncommand="BrowserOpenSyncTabs();" label="&appMenuRemoteTabs.sidebar.label;"/> <toolbarbutton id="PanelUI-remotetabs-syncnow" observes="sync-status" |