Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 443fc2f

Browse files
author
Allison Naaktgeboren
committed
Bug 868523 - snapped synced tabs entry doesnt hide if sync is not enabled.r=jimm
1 parent 087cee3 commit 443fc2f

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

browser/metro/base/content/RemoteTabs.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ Components.utils.import("resource://services-sync/main.js");
1919
* disabled. Must sanely support 'hidden' attribute.
2020
* You may only have one UI access point at this time.
2121
*/
22-
function RemoteTabsView(aSet, aSetUIAccess) {
22+
function RemoteTabsView(aSet, aSetUIAccessList) {
2323
this._set = aSet;
2424
this._set.controller = this;
25-
this._uiAccessElement = aSetUIAccess;
25+
this._uiAccessElements = aSetUIAccessList;
2626

2727
// Sync uses special voodoo observers.
2828
// If you want to change this code, talk to the fx-si team
@@ -38,7 +38,7 @@ function RemoteTabsView(aSet, aSetUIAccess) {
3838

3939
RemoteTabsView.prototype = {
4040
_set: null,
41-
_uiAccessElement: null,
41+
_uiAccessElements: [],
4242

4343
handleItemClick: function tabview_handleItemClick(aItem) {
4444
let url = aItem.getAttribute("value");
@@ -57,7 +57,9 @@ RemoteTabsView.prototype = {
5757
},
5858

5959
setUIAccessVisible: function setUIAccessVisible(aVisible) {
60-
this._uiAccessElement.hidden = !aVisible;
60+
for (let elem of this._uiAccessElements) {
61+
elem.hidden = !aVisible;
62+
}
6163
},
6264

6365
populateGrid: function populateGrid() {
@@ -108,7 +110,8 @@ let RemoteTabsStartView = {
108110

109111
init: function init() {
110112
let vbox = document.getElementById("start-remotetabs");
111-
this._view = new RemoteTabsView(this._grid, vbox);
113+
let uiList = [vbox];
114+
this._view = new RemoteTabsView(this._grid, uiList);
112115
},
113116

114117
uninit: function uninit() {
@@ -127,9 +130,11 @@ let RemoteTabsPanelView = {
127130
get visible() { return PanelUI.isPaneVisible("remotetabs-container"); },
128131

129132
init: function init() {
130-
//decks are fragile, don't hide the tab panel(bad things happen), hide link.
133+
//decks are fragile, don't hide the tab panel(bad things happen), hide link in menu.
131134
let menuEntry = document.getElementById("menuitem-remotetabs");
132-
this._view = new RemoteTabsView(this._grid, menuEntry);
135+
let snappedEntry = document.getElementById("snappedRemoteTabsLabel");
136+
let uiList = [menuEntry, snappedEntry];
137+
this._view = new RemoteTabsView(this._grid, uiList);
133138
},
134139

135140
show: function show() {

browser/metro/base/content/browser.xul

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
onclick="PanelUI.show('bookmarks-container');"/>
292292
<label class="meta-section-title" value="&startHistoryHeader.label;"
293293
onclick="PanelUI.show('history-container');" inputProcessing="true"/>
294-
<label class="meta-section-title" value="&startRemoteTabsHeader.label;"
294+
<label id="snappedRemoteTabsLabel" class="meta-section-title" value="&snappedRemoteTabsHeader.label;"
295295
onclick="PanelUI.show('remotetabs-container');" inputProcessing="true"/>
296296
</scrollbox>
297297
</vbox>

browser/metro/locales/en-US/chrome/browser.dtd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<!ENTITY startBookmarksHeader.label "Bookmarks">
1818
<!ENTITY startHistoryHeader.label "Recent History">
1919
<!ENTITY startRemoteTabsHeader.label "Tabs from Other Devices">
20+
<!-- LOCALIZATION NOTE (snappedRemoteTabsHeader.label): shortened version of startRemoteTabsHeader.label.
21+
Needs to be two words or shorter to fit in narrow vertical space.-->
22+
<!ENTITY snappedRemoteTabsHeader.label "Remote Tabs">
2023

2124
<!ENTITY autocompleteResultsHeader.label "Your Results">
2225
<!ENTITY autocompleteSearchesHeader.label "Internet Searches">

0 commit comments

Comments
 (0)