mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 571897 (Sync UI) - Part 3: General hookup [r=dolske]
This commit is contained in:
parent
503347b37b
commit
a0f738c0fd
@ -148,6 +148,14 @@ __defineSetter__("PluralForm", function (val) {
|
||||
return this.PluralForm = val;
|
||||
});
|
||||
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
XPCOMUtils.defineLazyGetter(this, "Weave", function() {
|
||||
let tmp = {};
|
||||
Cu.import("resource://services-sync/service.js", tmp);
|
||||
return tmp.Weave;
|
||||
});
|
||||
#endif
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () {
|
||||
let tmp = {};
|
||||
Cu.import("resource://gre/modules/PopupNotifications.jsm", tmp);
|
||||
|
@ -380,6 +380,29 @@ BrowserGlue.prototype = {
|
||||
temp.WinTaskbarJumpList.startup();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_SERVICES_SYNC
|
||||
// Assume that a non-zero value for services.sync.autoconnectDelay should override
|
||||
if (Services.prefs.prefHasUserValue("services.sync.autoconnectDelay")) {
|
||||
let prefDelay = Services.prefs.getIntPref("services.sync.autoconnectDelay");
|
||||
|
||||
if (prefDelay > 0)
|
||||
return;
|
||||
}
|
||||
|
||||
// delays are in seconds
|
||||
const MAX_DELAY = 300;
|
||||
let delay = 3;
|
||||
let enum = Services.wm.getEnumerator("navigator:browser");
|
||||
while (enum.hasMoreElements()) {
|
||||
delay += enum.getNext().gBrowser.tabs.length;
|
||||
}
|
||||
delay = delay <= MAX_DELAY ? delay : MAX_DELAY;
|
||||
|
||||
let syncTemp = {};
|
||||
Cu.import("resource://services-sync/service.js", syncTemp);
|
||||
syncTemp.Weave.Service.delayedAutoConnect(delay);
|
||||
#endif
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user