зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset de47b64c35f1 (bug 1549808) for failing at browser_masterPassword.js on a CLOSED TREE.
This commit is contained in:
Родитель
a846d2015c
Коммит
8e5d745f7d
|
@ -154,7 +154,6 @@ let LEGACY_ACTORS = {
|
|||
"AboutLogins:LoginModified",
|
||||
"AboutLogins:LoginRemoved",
|
||||
"AboutLogins:MasterPasswordResponse",
|
||||
"AboutLogins:SendFavicons",
|
||||
"AboutLogins:SyncState",
|
||||
"AboutLogins:UpdateBreaches",
|
||||
],
|
||||
|
|
|
@ -167,9 +167,6 @@ class AboutLoginsChild extends ActorChild {
|
|||
if (masterPasswordPromise) {
|
||||
masterPasswordPromise.resolve(message.data);
|
||||
}
|
||||
case "AboutLogins:SendFavicons":
|
||||
this.sendToContent("SendFavicons", message.data);
|
||||
break;
|
||||
case "AboutLogins:SyncState":
|
||||
this.sendToContent("SyncState", message.data);
|
||||
break;
|
||||
|
|
|
@ -35,12 +35,6 @@ ChromeUtils.defineModuleGetter(
|
|||
"resource://services-sync/UIState.jsm"
|
||||
);
|
||||
|
||||
ChromeUtils.defineModuleGetter(
|
||||
this,
|
||||
"PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm"
|
||||
);
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "log", () => {
|
||||
return LoginHelper.createLogger("AboutLoginsParent");
|
||||
});
|
||||
|
@ -267,19 +261,16 @@ var AboutLoginsParent = {
|
|||
messageManager.sendAsyncMessage("AboutLogins:SyncState", syncState);
|
||||
this.updatePasswordSyncNotificationState();
|
||||
|
||||
if (BREACH_ALERTS_ENABLED) {
|
||||
const breachesByLoginGUID = await LoginHelper.getBreachesForLogins(
|
||||
logins
|
||||
);
|
||||
messageManager.sendAsyncMessage(
|
||||
"AboutLogins:UpdateBreaches",
|
||||
breachesByLoginGUID
|
||||
);
|
||||
if (!BREACH_ALERTS_ENABLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
const breachesByLoginGUID = await LoginHelper.getBreachesForLogins(
|
||||
logins
|
||||
);
|
||||
messageManager.sendAsyncMessage(
|
||||
"AboutLogins:SendFavicons",
|
||||
await this.getAllFavicons(logins)
|
||||
"AboutLogins:UpdateBreaches",
|
||||
breachesByLoginGUID
|
||||
);
|
||||
} catch (ex) {
|
||||
if (ex.result != Cr.NS_ERROR_NOT_INITIALIZED) {
|
||||
|
@ -382,38 +373,6 @@ var AboutLoginsParent = {
|
|||
}
|
||||
},
|
||||
|
||||
async getFavicon(login) {
|
||||
try {
|
||||
const faviconData = await PlacesUtils.promiseFaviconData(login.hostname);
|
||||
return {
|
||||
faviconData,
|
||||
title: login.title,
|
||||
};
|
||||
} catch (ex) {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
async getAllFavicons(logins) {
|
||||
let favicons = await Promise.all(
|
||||
logins.map(login => this.getFavicon(login))
|
||||
);
|
||||
let vanillaFavicons = {};
|
||||
for (let favicon of favicons) {
|
||||
if (!favicon) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
vanillaFavicons[favicon.title] = {
|
||||
data: favicon.faviconData.data,
|
||||
dataLen: favicon.faviconData.dataLen,
|
||||
mimeType: favicon.faviconData.mimeType,
|
||||
};
|
||||
} catch (ex) {}
|
||||
}
|
||||
return vanillaFavicons;
|
||||
},
|
||||
|
||||
showMasterPasswordLoginNotifications() {
|
||||
this.showNotifications({
|
||||
id: MASTER_PASSWORD_NOTIFICATION_ID,
|
||||
|
|
|
@ -90,11 +90,8 @@
|
|||
|
||||
<template id="login-list-item-template">
|
||||
<li class="login-list-item">
|
||||
<img class="favicon" src="chrome://mozapps/skin/places/defaultFavicon.svg" alt=""/>
|
||||
<div>
|
||||
<span class="title"></span>
|
||||
<span class="username"></span>
|
||||
</div>
|
||||
<span class="title"></span>
|
||||
<span class="username"></span>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
|
@ -107,7 +104,6 @@
|
|||
<a class="breach-alert-link" data-l10n-id="breach-alert-link" rel="noopener noreferer" target="_blank"></a>
|
||||
</div>
|
||||
<div class="header">
|
||||
<img class="login-item-favicon" src="chrome://mozapps/skin/places/defaultFavicon.svg" alt=""/>
|
||||
<h2 class="title">
|
||||
<span class="login-item-title"></span>
|
||||
<span class="new-login-title" data-l10n-id="login-item-new-login-title"></span>
|
||||
|
|
|
@ -47,10 +47,6 @@ window.addEventListener("AboutLoginsChromeToContent", event => {
|
|||
gElements.loginItem.loginRemoved(event.detail.value);
|
||||
break;
|
||||
}
|
||||
case "SendFavicons": {
|
||||
gElements.loginList.addFavicons(event.detail.value);
|
||||
break;
|
||||
}
|
||||
case "SyncState": {
|
||||
gElements.fxAccountsButton.updateState(event.detail.value);
|
||||
break;
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid var(--in-content-box-border-color);
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
@ -191,11 +190,6 @@
|
|||
box-shadow: 0 0 0 4px var(--in-content-border-active-shadow);
|
||||
}
|
||||
|
||||
.login-item-favicon {
|
||||
width: 38px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.breach-alert {
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--in-content-border-color);
|
||||
|
|
|
@ -54,7 +54,6 @@ export default class LoginItem extends HTMLElement {
|
|||
this._saveChangesButton = this.shadowRoot.querySelector(
|
||||
".save-changes-button"
|
||||
);
|
||||
this._favicon = this.shadowRoot.querySelector(".login-item-favicon");
|
||||
this._title = this.shadowRoot.querySelector(".login-item-title");
|
||||
this._timeCreated = this.shadowRoot.querySelector(".time-created");
|
||||
this._timeChanged = this.shadowRoot.querySelector(".time-changed");
|
||||
|
@ -75,7 +74,6 @@ export default class LoginItem extends HTMLElement {
|
|||
this._revealCheckbox.addEventListener("click", this);
|
||||
window.addEventListener("AboutLoginsCreateLogin", this);
|
||||
window.addEventListener("AboutLoginsInitialLoginSelected", this);
|
||||
window.addEventListener("AboutLoginsLoadInitialFavicon", this);
|
||||
window.addEventListener("AboutLoginsLoginSelected", this);
|
||||
}
|
||||
|
||||
|
@ -99,17 +97,6 @@ export default class LoginItem extends HTMLElement {
|
|||
timeUsed: this._login.timeLastUsed || "",
|
||||
});
|
||||
|
||||
if (this._login.faviconDataURI) {
|
||||
this._favicon.src = this._login.faviconDataURI;
|
||||
document.l10n.setAttributes(this._favicon, "login-favicon", {
|
||||
title: this._login.title,
|
||||
});
|
||||
} else {
|
||||
// reset the src and alt attributes if the currently selected favicon doesn't have a favicon
|
||||
this._favicon.src = "chrome://mozapps/skin/places/defaultFavicon.svg";
|
||||
this._favicon.alt = "";
|
||||
}
|
||||
|
||||
this._title.textContent = this._login.title;
|
||||
this._originInput.defaultValue = this._login.origin || "";
|
||||
this._usernameInput.defaultValue = this._login.username || "";
|
||||
|
@ -138,10 +125,6 @@ export default class LoginItem extends HTMLElement {
|
|||
this.setLogin(event.detail, { skipFocusChange: true });
|
||||
break;
|
||||
}
|
||||
case "AboutLoginsLoadInitialFavicon": {
|
||||
this.setLogin(event.detail, { skipFocusChange: true });
|
||||
break;
|
||||
}
|
||||
case "AboutLoginsLoginSelected": {
|
||||
this.setLogin(event.detail);
|
||||
break;
|
||||
|
|
|
@ -17,7 +17,7 @@ export default class LoginListItemFactory {
|
|||
let listItem = loginListItem.querySelector("li");
|
||||
let title = loginListItem.querySelector(".title");
|
||||
let username = loginListItem.querySelector(".username");
|
||||
let favicon = loginListItem.querySelector(".favicon");
|
||||
|
||||
listItem.setAttribute("role", "option");
|
||||
|
||||
if (!login.guid) {
|
||||
|
@ -45,13 +45,6 @@ export default class LoginListItemFactory {
|
|||
);
|
||||
}
|
||||
|
||||
if (login.faviconDataURI) {
|
||||
favicon.src = login.faviconDataURI;
|
||||
document.l10n.setAttributes(favicon, "login-favicon", {
|
||||
title: login.title,
|
||||
});
|
||||
}
|
||||
|
||||
return listItem;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,8 +53,7 @@ ol {
|
|||
}
|
||||
|
||||
.login-list-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
display: block;
|
||||
padding: 10px;
|
||||
padding-inline-end: 18px;
|
||||
padding-inline-start: 14px;
|
||||
|
@ -92,11 +91,6 @@ ol {
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
.favicon {
|
||||
width: 16px;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.username {
|
||||
font-size: 0.85em;
|
||||
color: var(--in-content-deemphasized-text);
|
||||
|
|
|
@ -217,33 +217,6 @@ export default class LoginList extends HTMLElement {
|
|||
}
|
||||
}
|
||||
|
||||
addFavicons(favicons) {
|
||||
for (let login of this._logins) {
|
||||
const favicon = favicons[login.title];
|
||||
if (favicon && login.title) {
|
||||
favicon.uri = btoa(
|
||||
new Uint8Array(favicon.data).reduce(
|
||||
(data, byte) => data + String.fromCharCode(byte),
|
||||
""
|
||||
)
|
||||
);
|
||||
let faviconDataURI = `data:${favicon.mimeType};base64,${favicon.uri}`;
|
||||
login.faviconDataURI = faviconDataURI;
|
||||
}
|
||||
}
|
||||
let selectedListItem = this._list.querySelector(
|
||||
".login-list-item.selected"
|
||||
);
|
||||
if (selectedListItem) {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent("AboutLoginsLoadInitialFavicon", {
|
||||
detail: selectedListItem._login,
|
||||
})
|
||||
);
|
||||
}
|
||||
this.render();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Map} breachesByLoginGUID A Map of breaches by login GUIDs used for displaying breached login indicators.
|
||||
*/
|
||||
|
|
|
@ -9,12 +9,6 @@ login-filter =
|
|||
|
||||
create-login-button = Create New Login
|
||||
|
||||
# This string is used as alternative text for favicon images.
|
||||
# Variables:
|
||||
# $title (String) - The title of the website associated with the favicon.
|
||||
login-favicon =
|
||||
.alt = Favicon for { $title }
|
||||
|
||||
fxaccounts-sign-in-text = Get your passwords on your other devices
|
||||
fxaccounts-sign-in-button = Sign in to { -sync-brand-short-name }
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче