зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1562328 - Hook up the enable and options Sync buttons to their respective sites. r=MattN,lina
Differential Revision: https://phabricator.services.mozilla.com/D38736 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
0f2338c828
Коммит
a8360e85b5
|
@ -136,6 +136,8 @@ let LEGACY_ACTORS = {
|
|||
AboutLoginsOpenPreferences: { wantUntrusted: true },
|
||||
AboutLoginsOpenSite: { wantUntrusted: true },
|
||||
AboutLoginsRecordTelemetryEvent: { wantUntrusted: true },
|
||||
AboutLoginsSyncEnable: { wantUntrusted: true },
|
||||
AboutLoginsSyncOptions: { wantUntrusted: true },
|
||||
AboutLoginsUpdateLogin: { wantUntrusted: true },
|
||||
},
|
||||
messages: [
|
||||
|
@ -632,6 +634,8 @@ const listeners = {
|
|||
"AboutLogins:OpenMobileIos": ["AboutLoginsParent"],
|
||||
"AboutLogins:OpenSite": ["AboutLoginsParent"],
|
||||
"AboutLogins:Subscribe": ["AboutLoginsParent"],
|
||||
"AboutLogins:SyncEnable": ["AboutLoginsParent"],
|
||||
"AboutLogins:SyncOptions": ["AboutLoginsParent"],
|
||||
"AboutLogins:UpdateLogin": ["AboutLoginsParent"],
|
||||
"Content:Click": ["ContentClick"],
|
||||
ContentSearch: ["ContentSearch"],
|
||||
|
|
|
@ -132,6 +132,14 @@ class AboutLoginsChild extends ActorChild {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case "AboutLoginsSyncEnable": {
|
||||
this.mm.sendAsyncMessage("AboutLogins:SyncEnable");
|
||||
break;
|
||||
}
|
||||
case "AboutLoginsSyncOptions": {
|
||||
this.mm.sendAsyncMessage("AboutLogins:SyncOptions");
|
||||
break;
|
||||
}
|
||||
case "AboutLoginsUpdateLogin": {
|
||||
this.mm.sendAsyncMessage("AboutLogins:UpdateLogin", {
|
||||
login: event.detail,
|
||||
|
|
|
@ -116,6 +116,16 @@ var AboutLoginsParent = {
|
|||
Services.logins.removeLogin(login);
|
||||
break;
|
||||
}
|
||||
case "AboutLogins:SyncEnable": {
|
||||
message.target.ownerGlobal.gSync.openFxAEmailFirstPage(
|
||||
"password-manager"
|
||||
);
|
||||
break;
|
||||
}
|
||||
case "AboutLogins:SyncOptions": {
|
||||
message.target.ownerGlobal.gSync.openFxAManagePage("password-manager");
|
||||
break;
|
||||
}
|
||||
case "AboutLogins:Import": {
|
||||
try {
|
||||
MigrationUtils.showMigrationWizard(message.target.ownerGlobal, [
|
||||
|
@ -246,6 +256,11 @@ var AboutLoginsParent = {
|
|||
const logins = await this.getAllLogins();
|
||||
try {
|
||||
messageManager.sendAsyncMessage("AboutLogins:AllLogins", logins);
|
||||
|
||||
let syncState = this.getSyncState();
|
||||
messageManager.sendAsyncMessage("AboutLogins:SyncState", syncState);
|
||||
this.updatePasswordSyncNotificationState();
|
||||
|
||||
if (!BREACH_ALERTS_ENABLED) {
|
||||
return;
|
||||
}
|
||||
|
@ -257,9 +272,6 @@ var AboutLoginsParent = {
|
|||
"AboutLogins:UpdateBreaches",
|
||||
breachesByLoginGUID
|
||||
);
|
||||
let syncState = this.getSyncState();
|
||||
messageManager.sendAsyncMessage("AboutLogins:SyncState", syncState);
|
||||
this.updatePasswordSyncNotificationState();
|
||||
} catch (ex) {
|
||||
if (ex.result != Cr.NS_ERROR_NOT_INITIALIZED) {
|
||||
throw ex;
|
||||
|
|
|
@ -20,9 +20,30 @@ export default class FxAccountsButton extends HTMLElement {
|
|||
this._loggedInView = shadowRoot.querySelector(".logged-in-view");
|
||||
this._emailText = shadowRoot.querySelector(".fxaccount-email");
|
||||
|
||||
this._avatarButton.addEventListener("click", this);
|
||||
this._enableButton.addEventListener("click", this);
|
||||
|
||||
this.render();
|
||||
}
|
||||
|
||||
handleEvent(event) {
|
||||
if (event.target == this._avatarButton) {
|
||||
document.dispatchEvent(
|
||||
new CustomEvent("AboutLoginsSyncOptions", {
|
||||
bubbles: true,
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (event.target == this._enableButton) {
|
||||
document.dispatchEvent(
|
||||
new CustomEvent("AboutLoginsSyncEnable", {
|
||||
bubbles: true,
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
this._loggedOutView.hidden = !!this._loggedIn;
|
||||
this._loggedInView.hidden = !this._loggedIn;
|
||||
|
|
Загрузка…
Ссылка в новой задаче