Bug 831614 - Metro code to auto-import sync credentials. r=mbrubeck

This commit is contained in:
Brian R. Bondy 2013-03-15 10:30:02 -04:00
Родитель f4544a1c98
Коммит 1d2e3589ff
2 изменённых файлов: 41 добавлений и 1 удалений

Просмотреть файл

@ -30,6 +30,39 @@ let WeaveGlue = {
}
},
#ifdef XP_WIN
_securelySetupFromMetro: function() {
let metroUtils = Cc["@mozilla.org/windows-metroutils;1"].
createInstance(Ci.nsIWinMetroUtils);
var email = {}, password = {}, key = {};
try {
metroUtils.loadSyncInfo(email, password, key);
} catch (ex) {
return false;
}
let server = Weave.Service.serverURL;
let defaultPrefs = Services.prefs.getDefaultBranch(null);
if (server == defaultPrefs.getCharPref("services.sync.serverURL"))
server = "";
this.setupData = {
account: email.value,
password: password.value,
synckey: key.value,
serverURL: server
};
try {
metroUtils.clearSyncInfo();
} catch (ex) {
}
this.connect();
return true;
},
#endif
_init: function () {
this._bundle = Services.strings.createBundle("chrome://browser/locale/sync.properties");
this._msg = document.getElementById("prefs-messages");
@ -49,9 +82,16 @@ let WeaveGlue = {
} else if (Weave.Status.login != Weave.LOGIN_FAILED_NO_USERNAME) {
this.loadSetupData();
}
this._boundOnEngineSync = this.onEngineSync.bind(this);
this._boundOnServiceSync = this.onServiceSync.bind(this);
this._progressBar = document.getElementById("syncsetup-progressbar");
#ifdef XP_WIN
if (Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED) {
this._securelySetupFromMetro();
}
#endif
},
abortEasySetup: function abortEasySetup() {

Просмотреть файл

@ -91,7 +91,7 @@ chrome.jar:
content/LoginManagerChild.js (content/LoginManagerChild.js)
content/video.js (content/video.js)
#ifdef MOZ_SERVICES_SYNC
content/sync.js (content/sync.js)
* content/sync.js (content/sync.js)
content/RemoteTabs.js (content/RemoteTabs.js)
#endif