&aboutHome.remoteTabs;
@@ -119,6 +119,10 @@
initAddons();
}
+ function uninit() {
+ uninitWeave();
+ }
+
function _readFile(aFile) {
try {
let stream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream);
@@ -212,11 +216,11 @@
outer.className = "openall";
outer.textContent = document.getElementById("text-openalltabs").textContent;
outer.setAttribute("role", "button");
-
+
outer.addEventListener("click", function() {
openTabs(allPageURLs);
}, false);
-
+
list.appendChild(outer);
}
} else {
@@ -226,8 +230,27 @@
}
function initWeave() {
- if (!("WeaveGlue" in getChromeWin()))
+ let chromeWin = getChromeWin();
+ if ("WeaveGlue" in chromeWin) {
+ chromeWin.Services.obs.addObserver(updateWeaveButton, "weave:service:login:finish", false);
+ chromeWin.Services.obs.addObserver(updateWeaveButton, "weave:service:logout:finish", false);
+ }
+ else {
document.getElementById("remoteTabs").style.display = "none";
+ }
+ }
+
+ function uninitWeave() {
+ let chromeWin = getChromeWin();
+ if ("WeaveGlue" in chromeWin) {
+ chromeWin.Services.obs.removeObserver(updateWeaveButton, "weave:service:login:finish");
+ chromeWin.Services.obs.removeObserver(updateWeaveButton, "weave:service:logout:finish");
+ }
+ }
+
+ function updateWeaveButton() {
+ let isDisabled = !getChromeWin().Weave.Service.isLoggedIn;
+ document.getElementById("remoteTabs").setAttribute("disabled", isDisabled);
}
function openRemoteTabs() {
diff --git a/mobile/chrome/content/browser-ui.js b/mobile/chrome/content/browser-ui.js
index ede16ad315ba..3af1efceda41 100644
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -425,8 +425,10 @@ var BrowserUI = {
.ensureContentProcess();
#endif
+#ifdef MOZ_SERVICES_SYNC
// Init the sync system
WeaveGlue.init();
+#endif
});
FormHelperUI.init();
@@ -2255,9 +2257,11 @@ XPCOMUtils.defineLazyGetter(this, "HistoryList", function() {
return new AwesomePanel("history-items", "cmd_history");
});
+#ifdef MOZ_SERVICES_SYNC
XPCOMUtils.defineLazyGetter(this, "RemoteTabsList", function() {
return new AwesomePanel("remotetabs-items", "cmd_remoteTabs");
});
+#endif
XPCOMUtils.defineLazyGetter(this, "AllPagesList", function() {
return new AwesomePanel("popup_autocomplete", "cmd_openLocation");
diff --git a/mobile/chrome/content/browser.xul b/mobile/chrome/content/browser.xul
index ffc2c24e777c..a29ad23eb86b 100644
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -87,7 +87,9 @@
+#ifdef MOZ_SERVICES_SYNC
+#endif
@@ -115,7 +117,9 @@
+#ifdef MOZ_SERVICES_SYNC
+#endif
@@ -448,6 +452,7 @@
+#ifdef MOZ_SERVICES_SYNC
@@ -463,6 +468,7 @@
+#endif
@@ -497,7 +503,9 @@
+#ifdef MOZ_SERVICES_SYNC
+#endif
diff --git a/mobile/chrome/jar.mn b/mobile/chrome/jar.mn
index a25e3dc24110..381d58e1e1ae 100644
--- a/mobile/chrome/jar.mn
+++ b/mobile/chrome/jar.mn
@@ -57,7 +57,9 @@ chrome.jar:
content/prompt/prompt.js (content/prompt/prompt.js)
content/share.xul (content/share.xul)
content/AnimatedZoom.js (content/AnimatedZoom.js)
+#ifdef MOZ_SERVICES_SYNC
content/sync.js (content/sync.js)
+#endif
content/LoginManagerChild.js (content/LoginManagerChild.js)
% override chrome://global/content/config.xul chrome://browser/content/config.xul
diff --git a/mobile/themes/core/aboutHome.css b/mobile/themes/core/aboutHome.css
index 12789b2bd3c6..54cd4909e3f8 100644
--- a/mobile/themes/core/aboutHome.css
+++ b/mobile/themes/core/aboutHome.css
@@ -143,6 +143,15 @@ html {
background: url("images/arrowright-16.png") 99% center no-repeat;
}
+#remoteTabs[disabled=true] {
+ pointer-events: none;
+ color: #aaa;
+}
+
+#remoteTabs[disabled=true] > div > .favicon {
+ opacity: 0.5;
+}
+
.section-row {
color: black;
background: transparent -moz-linear-gradient(top, rgba(235,235,235,0.2) 0%, rgba(235,235,235,1) 90%);