mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1692322 - Move view saved logins context menu item to the top level and rename to manage logins. r=sfoster,fluent-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D106470
This commit is contained in:
parent
515acfbef4
commit
3a5b3ae9ff
@ -256,17 +256,17 @@
|
||||
label="&noLoginSuggestions.label;"
|
||||
disabled="true"
|
||||
hidden="true"/>
|
||||
<menuseparator id="saved-logins-separator"/>
|
||||
<menuitem id="fill-login-saved-passwords"
|
||||
label="&viewSavedLogins.label;"
|
||||
oncommand="gContextMenu.openPasswordManager();"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuitem id="fill-login-generated-password"
|
||||
data-l10n-id="main-context-menu-generate-new-password"
|
||||
hidden="true"
|
||||
oncommand="gContextMenu.useGeneratedPassword();"/>
|
||||
<menuseparator id="fill-login-and-generated-password-separator"/>
|
||||
<menuitem id="manage-saved-logins"
|
||||
data-l10n-id="main-context-menu-manage-logins"
|
||||
hidden = "true"
|
||||
oncommand="gContextMenu.openPasswordManager();"/>
|
||||
<menuseparator id="passwordmgr-items-separator"/>
|
||||
<menuitem id="context-undo"
|
||||
data-l10n-id="text-action-undo"
|
||||
command="cmd_undo"/>
|
||||
|
@ -955,14 +955,16 @@ class nsContextMenu {
|
||||
initPasswordManagerItems() {
|
||||
let showFill = false;
|
||||
let showGenerate = false;
|
||||
let showManage = false;
|
||||
let enableGeneration = Services.logins.isLoggedIn;
|
||||
try {
|
||||
// If we could not find a password field we
|
||||
// don't want to show the form fill option.
|
||||
// If we could not find a password field we don't want to
|
||||
// show the form fill, manage logins and the password generation items.
|
||||
if (!this.isLoginForm()) {
|
||||
return;
|
||||
}
|
||||
showFill = true;
|
||||
showManage = true;
|
||||
|
||||
// Disable the fill option if the user hasn't unlocked with their master password
|
||||
// or if the password field or target field are disabled.
|
||||
@ -1026,14 +1028,15 @@ class nsContextMenu {
|
||||
} finally {
|
||||
this.showItem("fill-login", showFill);
|
||||
this.showItem("fill-login-generated-password", showGenerate);
|
||||
this.showItem("manage-saved-logins", showManage);
|
||||
this.setItemAttr(
|
||||
"fill-login-generated-password",
|
||||
"disabled",
|
||||
!enableGeneration
|
||||
);
|
||||
this.showItem(
|
||||
"fill-login-and-generated-password-separator",
|
||||
showFill || showGenerate
|
||||
"passwordmgr-items-separator",
|
||||
showFill || showGenerate || showManage
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -6,15 +6,10 @@ let LOGIN_FILL_ITEMS = [
|
||||
null,
|
||||
"fill-login",
|
||||
null,
|
||||
[
|
||||
"fill-login-no-logins",
|
||||
false,
|
||||
"---",
|
||||
null,
|
||||
"fill-login-saved-passwords",
|
||||
true,
|
||||
],
|
||||
["fill-login-no-logins", false],
|
||||
null,
|
||||
"manage-saved-logins",
|
||||
true,
|
||||
];
|
||||
let hasPocket = Services.prefs.getBoolPref("extensions.pocket.enabled");
|
||||
let hasContainers =
|
||||
|
@ -88,15 +88,10 @@ add_task(async function test_password_input() {
|
||||
[
|
||||
"fill-login",
|
||||
null,
|
||||
[
|
||||
"fill-login-no-logins",
|
||||
false,
|
||||
"---",
|
||||
null,
|
||||
"fill-login-saved-passwords",
|
||||
true,
|
||||
],
|
||||
["fill-login-no-logins", false],
|
||||
null,
|
||||
"manage-saved-logins",
|
||||
true,
|
||||
"---",
|
||||
null,
|
||||
"context-undo",
|
||||
|
@ -84,15 +84,10 @@ add_task(async function test_text_input_spellcheck_loginform() {
|
||||
[
|
||||
"fill-login",
|
||||
null,
|
||||
[
|
||||
"fill-login-no-logins",
|
||||
false,
|
||||
"---",
|
||||
null,
|
||||
"fill-login-saved-passwords",
|
||||
true,
|
||||
],
|
||||
["fill-login-no-logins", false],
|
||||
null,
|
||||
"manage-saved-logins",
|
||||
true,
|
||||
"---",
|
||||
null,
|
||||
"context-undo",
|
||||
|
@ -83,7 +83,6 @@ function getVisibleMenuItems(aMenu, aData) {
|
||||
item.id != "spell-no-suggestions" &&
|
||||
item.id != "spell-add-dictionaries-main" &&
|
||||
item.id != "context-savelinktopocket" &&
|
||||
item.id != "fill-login-saved-passwords" &&
|
||||
item.id != "fill-login-no-logins" &&
|
||||
// XXX Screenshots doesn't have an access key. This needs
|
||||
// at least bug 1320462 fixing first.
|
||||
|
@ -306,6 +306,10 @@ main-context-menu-generate-new-password =
|
||||
.label = Use Generated Password…
|
||||
.accesskey = G
|
||||
|
||||
main-context-menu-manage-logins =
|
||||
.label = Manage Logins…
|
||||
.accesskey = M
|
||||
|
||||
main-context-menu-keyword =
|
||||
.label = Add a Keyword for this Search…
|
||||
.accesskey = K
|
||||
|
@ -54,7 +54,7 @@ add_task(async function test_hidden_by_prefs() {
|
||||
);
|
||||
let fillLoginItem = document.getElementById("fill-login");
|
||||
let generatedPasswordSeparator = document.getElementById(
|
||||
"fill-login-and-generated-password-separator"
|
||||
"passwordmgr-items-separator"
|
||||
);
|
||||
|
||||
ok(
|
||||
@ -94,7 +94,7 @@ add_task(async function test_fill_hidden_by_login_saving_disabled() {
|
||||
);
|
||||
let fillLoginItem = document.getElementById("fill-login");
|
||||
let generatedPasswordSeparator = document.getElementById(
|
||||
"fill-login-and-generated-password-separator"
|
||||
"passwordmgr-items-separator"
|
||||
);
|
||||
|
||||
ok(
|
||||
@ -139,7 +139,7 @@ add_task(async function test_fill_hidden_by_locked_master_password() {
|
||||
);
|
||||
let fillLoginItem = document.getElementById("fill-login");
|
||||
let generatedPasswordSeparator = document.getElementById(
|
||||
"fill-login-and-generated-password-separator"
|
||||
"passwordmgr-items-separator"
|
||||
);
|
||||
|
||||
ok(
|
||||
|
@ -789,7 +789,7 @@ async function doFillGeneratedPasswordContextMenuItem(browser, passwordInput) {
|
||||
"fill-login-generated-password"
|
||||
);
|
||||
let generatedPasswordSeparator = document.getElementById(
|
||||
"fill-login-and-generated-password-separator"
|
||||
"passwordmgr-items-separator"
|
||||
);
|
||||
|
||||
ok(
|
||||
|
@ -21,4 +21,3 @@
|
||||
<!ENTITY fillUsernameMenu.label "Fill Username">
|
||||
<!ENTITY fillUsernameMenu.accesskey "F">
|
||||
<!ENTITY noLoginSuggestions.label "(No Login Suggestions)">
|
||||
<!ENTITY viewSavedLogins.label "View Saved Logins">
|
||||
|
Loading…
Reference in New Issue
Block a user