Bug 1697484 - Update copy for Add/Update Password panel. r=sfoster,flod
authorMike Conley <mconley@mozilla.com>
Wed, 10 Mar 2021 20:07:05 +0000
changeset 570545 bcdf461c94db642a23b96fce2ae177046affa6ac
parent 570544 212b6f5689b09e20f490519271c9fdb06e932ece
child 570546 7490d86b91d5d7ba47ddce1cb3d934484f359366
push id38277
push usersmolnar@mozilla.com
push dateThu, 11 Mar 2021 09:30:01 +0000
treeherdermozilla-central@bd8121e747b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfoster, flod
bugs1697484
milestone88.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1697484 - Update copy for Add/Update Password panel. r=sfoster,flod Differential Revision: https://phabricator.services.mozilla.com/D107877
toolkit/components/passwordmgr/LoginManagerPrompter.jsm
toolkit/components/passwordmgr/test/browser/browser_doorhanger_remembering.js
toolkit/locales/en-US/chrome/passwordmgr/passwordmgr.properties
--- a/toolkit/components/passwordmgr/LoginManagerPrompter.jsm
+++ b/toolkit/components/passwordmgr/LoginManagerPrompter.jsm
@@ -206,44 +206,43 @@ class LoginManagerPrompter {
     log.debug(
       `_showLoginCaptureDoorhanger, got autoSavedLoginGuid: ${autoSavedLoginGuid}`
     );
     log.debug(
       `_showLoginCaptureDoorhanger, got autoFilledLoginGuid: ${autoFilledLoginGuid}`
     );
 
     let saveMsgNames = {
-      prompt: login.username === "" ? "saveLoginMsgNoUser" : "saveLoginMsg",
+      prompt: login.username === "" ? "saveLoginMsgNoUser2" : "saveLoginMsg2",
       buttonLabel: "saveLoginButtonAllow.label",
       buttonAccessKey: "saveLoginButtonAllow.accesskey",
       secondaryButtonLabel: "saveLoginButtonDeny.label",
       secondaryButtonAccessKey: "saveLoginButtonDeny.accesskey",
     };
 
     let changeMsgNames = {
-      prompt: login.username === "" ? "updateLoginMsgNoUser" : "updateLoginMsg",
+      prompt:
+        login.username === "" ? "updateLoginMsgNoUser2" : "updateLoginMsg2",
       buttonLabel: "updateLoginButtonText",
       buttonAccessKey: "updateLoginButtonAccessKey",
       secondaryButtonLabel: "updateLoginButtonDeny.label",
       secondaryButtonAccessKey: "updateLoginButtonDeny.accesskey",
     };
 
     let initialMsgNames =
       type == "password-save" ? saveMsgNames : changeMsgNames;
 
     if (messageStringID) {
       changeMsgNames.prompt = messageStringID;
     }
 
-    let brandBundle = Services.strings.createBundle(BRAND_BUNDLE);
-    let brandShortName = brandBundle.GetStringFromName("brandShortName");
     let host = this._getShortDisplayHost(login.origin);
     let promptMsg =
       type == "password-save"
-        ? this._getLocalizedString(saveMsgNames.prompt, [brandShortName, host])
+        ? this._getLocalizedString(saveMsgNames.prompt, [host])
         : this._getLocalizedString(changeMsgNames.prompt);
 
     let histogramName =
       type == "password-save"
         ? "PWMGR_PROMPT_REMEMBER_ACTION"
         : "PWMGR_PROMPT_UPDATE_ACTION";
     let histogram = Services.telemetry.getHistogramById(histogramName);
 
@@ -715,17 +714,17 @@ class LoginManagerPrompter {
                   // Don't show the toggle when the login was autofilled
                   !!autoFilledLoginGuid ||
                   // Dismissed-by-default prompts should still show the toggle.
                   (this.timeShown && this.wasDismissed) ||
                   // If we are only adding a username then the password is
                   // one that is already saved and we don't want to reveal
                   // it as the submitter of this form may not be the account
                   // owner, they may just be using the saved password.
-                  (messageStringID == "updateLoginMsgAddUsername" &&
+                  (messageStringID == "updateLoginMsgAddUsername2" &&
                     login.timePasswordChanged <
                       Date.now() - VISIBILITY_TOGGLE_MAX_PW_AGE_MS);
                 toggleBtn.hidden = hideToggle;
               }
 
               let popup = chromeDoc.getElementById("PopupAutoComplete");
               popup.onUsernameSelect = onUsernameSelect;
               popup.onPasswordSelect = onPasswordSelect;
@@ -844,17 +843,17 @@ class LoginManagerPrompter {
     if (
       aOldLogin.username === "" &&
       login.username !== "" &&
       login.password == aOldLogin.password
     ) {
       // If the saved password matches the password we're prompting with then we
       // are only prompting to let the user add a username since there was one in
       // the form. Change the message so the purpose of the prompt is clearer.
-      messageStringID = "updateLoginMsgAddUsername";
+      messageStringID = "updateLoginMsgAddUsername2";
     }
 
     LoginManagerPrompter._showLoginCaptureDoorhanger(
       aBrowser,
       login,
       "password-change",
       {
         dismissed,
--- a/toolkit/components/passwordmgr/test/browser/browser_doorhanger_remembering.js
+++ b/toolkit/components/passwordmgr/test/browser/browser_doorhanger_remembering.js
@@ -325,21 +325,17 @@ add_task(async function test_pwOnlyNewLo
   await testSubmittingLoginForm("subtst_notifications_1.html", async function(
     fieldValues
   ) {
     is(fieldValues.username, "notifyu1", "Checking submitted username");
     is(fieldValues.password, "notifyp1", "Checking submitted password");
     let notif = await getCaptureDoorhangerThatMayOpen("password-change");
     ok(notif, "checking for notification popup");
     ok(!notif.dismissed, "doorhanger is not dismissed");
-    is(
-      notif.message,
-      "Would you like to add a username to the saved password?",
-      "Check message"
-    );
+    is(notif.message, "Add username to saved password?", "Check message");
 
     let { panel } = PopupNotifications;
     let passwordVisiblityToggle = panel.querySelector(
       "#password-notification-visibilityToggle"
     );
     ok(
       !passwordVisiblityToggle.hidden,
       "Toggle visible for a recently saved pw"
@@ -380,21 +376,17 @@ add_task(async function test_pwOnlyOldLo
   await testSubmittingLoginForm("subtst_notifications_1.html", async function(
     fieldValues
   ) {
     is(fieldValues.username, "notifyu1", "Checking submitted username");
     is(fieldValues.password, "notifyp1", "Checking submitted password");
     let notif = await getCaptureDoorhangerThatMayOpen("password-change");
     ok(notif, "checking for notification popup");
     ok(!notif.dismissed, "doorhanger is not dismissed");
-    is(
-      notif.message,
-      "Would you like to add a username to the saved password?",
-      "Check message"
-    );
+    is(notif.message, "Add username to saved password?", "Check message");
 
     let { panel } = PopupNotifications;
     let passwordVisiblityToggle = panel.querySelector(
       "#password-notification-visibilityToggle"
     );
     ok(passwordVisiblityToggle.hidden, "Toggle hidden for an old saved pw");
 
     await checkDoorhangerUsernamePassword("notifyu1", "notifyp1");
@@ -472,17 +464,17 @@ add_task(async function test_changeUPLog
   await testSubmittingLoginForm("subtst_notifications_8.html", async function(
     fieldValues
   ) {
     is(fieldValues.username, "notifyu1", "Checking submitted username");
     is(fieldValues.password, "pass2", "Checking submitted password");
     let notif = await getCaptureDoorhangerThatMayOpen("password-change");
     ok(notif, "got notification popup");
     ok(!notif.dismissed, "doorhanger is not dismissed");
-    is(notif.message, "Would you like to update this login?", "Check message");
+    is(notif.message, "Update this login?", "Check message");
 
     await checkDoorhangerUsernamePassword("notifyu1", "pass2");
     clickDoorhangerButton(notif, DONT_CHANGE_BUTTON);
   });
 
   let logins = Services.logins.getAllLogins();
   is(logins.length, 1, "Should only have 1 login");
   let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
@@ -500,17 +492,17 @@ add_task(async function test_changeUPLog
   await testSubmittingLoginForm("subtst_notifications_8.html", async function(
     fieldValues
   ) {
     is(fieldValues.username, "notifyu1", "Checking submitted username");
     is(fieldValues.password, "pass2", "Checking submitted password");
     let notif = await getCaptureDoorhangerThatMayOpen("password-change");
     ok(notif, "got notification popup");
     ok(!notif.dismissed, "doorhanger is not dismissed");
-    is(notif.message, "Would you like to update this login?", "Check message");
+    is(notif.message, "Update this login?", "Check message");
 
     await checkDoorhangerUsernamePassword("notifyu1", "pass2");
     clickDoorhangerButton(notif, REMOVE_LOGIN_MENUITEM);
   });
 
   // Let the hint hide itself
   const forceClosePopup = false;
   // Make sure confirmation hint was shown
@@ -532,17 +524,17 @@ add_task(async function test_changeUPLog
   await testSubmittingLoginForm("subtst_notifications_8.html", async function(
     fieldValues
   ) {
     is(fieldValues.username, "notifyu1", "Checking submitted username");
     is(fieldValues.password, "pass2", "Checking submitted password");
     let notif = await getCaptureDoorhangerThatMayOpen("password-change");
     ok(notif, "got notification popup");
     ok(!notif.dismissed, "doorhanger is not dismissed");
-    is(notif.message, "Would you like to update this login?", "Check message");
+    is(notif.message, "Update this login?", "Check message");
 
     await checkDoorhangerUsernamePassword("notifyu1", "pass2");
     let promiseLoginUpdateSaved = TestUtils.topicObserved(
       "LoginStats:LoginUpdateSaved",
       (subject, data) => subject == gBrowser.selectedBrowser
     );
     clickDoorhangerButton(notif, CHANGE_BUTTON);
     await promiseLoginUpdateSaved;
@@ -572,17 +564,17 @@ add_task(async function test_changePLogi
   await testSubmittingLoginForm("subtst_notifications_9.html", async function(
     fieldValues
   ) {
     is(fieldValues.username, "", "Checking submitted username");
     is(fieldValues.password, "pass2", "Checking submitted password");
     let notif = await getCaptureDoorhangerThatMayOpen("password-change");
     ok(notif, "got notification popup");
     ok(!notif.dismissed, "doorhanger is not dismissed");
-    is(notif.message, "Would you like to update this password?", "Check msg");
+    is(notif.message, "Update this password?", "Check msg");
 
     await checkDoorhangerUsernamePassword("", "pass2");
     clickDoorhangerButton(notif, CHANGE_BUTTON);
 
     ok(!getCaptureDoorhanger("password-change"), "popup should be gone");
   });
 
   let logins = Services.logins.getAllLogins();
@@ -601,17 +593,17 @@ add_task(async function test_changePLogi
   await testSubmittingLoginForm("subtst_notifications_10.html", async function(
     fieldValues
   ) {
     is(fieldValues.username, "null", "Checking submitted username");
     is(fieldValues.password, "notifyp1", "Checking submitted password");
     let notif = await getCaptureDoorhangerThatMayOpen("password-change");
     ok(notif, "got notification popup");
     ok(!notif.dismissed, "doorhanger is not dismissed");
-    is(notif.message, "Would you like to update this password?", "Check msg");
+    is(notif.message, "Update this password?", "Check msg");
 
     await checkDoorhangerUsernamePassword("", "notifyp1");
     clickDoorhangerButton(notif, CHANGE_BUTTON);
 
     ok(!getCaptureDoorhanger("password-change"), "popup should be gone");
   });
 
   let logins = Services.logins.getAllLogins();
@@ -632,21 +624,18 @@ add_task(async function test_checkUPSave
   ) {
     is(fieldValues.username, "notifyu1", "Checking submitted username");
     is(fieldValues.password, "notifyp1", "Checking submitted password");
     let notif = await getCaptureDoorhangerThatMayOpen("password-save");
     ok(!notif.dismissed, "doorhanger is not dismissed");
     ok(notif, "got notification popup");
     // Check the text, which comes from the localized saveLoginMsg string.
     let notificationText = notif.message;
-    let expectedText =
-      "Would you like " +
-      BRAND_SHORT_NAME +
-      " to save this login for example.com?";
-    is(expectedText, notificationText, "Checking text: " + notificationText);
+    let expectedText = "Save login for example.com?";
+    is(notificationText, expectedText, "Checking text: " + notificationText);
     await cleanupDoorhanger(notif);
   });
 
   is(
     Services.logins.getAllLogins().length,
     0,
     "Should not have any logins yet"
   );
@@ -660,21 +649,18 @@ add_task(async function test_checkPSaveT
   ) {
     is(fieldValues.username, "null", "Checking submitted username");
     is(fieldValues.password, "notifyp1", "Checking submitted password");
     let notif = await getCaptureDoorhangerThatMayOpen("password-save");
     ok(!notif.dismissed, "doorhanger is not dismissed");
     ok(notif, "got notification popup");
     // Check the text, which comes from the localized saveLoginMsgNoUser string.
     let notificationText = notif.message;
-    let expectedText =
-      "Would you like " +
-      BRAND_SHORT_NAME +
-      " to save this password for example.com?";
-    is(expectedText, notificationText, "Checking text: " + notificationText);
+    let expectedText = "Save password for example.com?";
+    is(notificationText, expectedText, "Checking text: " + notificationText);
     await cleanupDoorhanger(notif);
   });
 
   is(
     Services.logins.getAllLogins().length,
     0,
     "Should not have any logins yet"
   );
--- a/toolkit/locales/en-US/chrome/passwordmgr/passwordmgr.properties
+++ b/toolkit/locales/en-US/chrome/passwordmgr/passwordmgr.properties
@@ -1,32 +1,32 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 rememberPassword = Use Password Manager to remember this password.
 savePasswordTitle = Confirm
-# LOCALIZATION NOTE (saveLoginMsg, saveLoginMsgNoUser):
-# %1$S is brandShortName, %2$S is the login's hostname.
-saveLoginMsg = Would you like %1$S to save this login for %2$S?
-saveLoginMsgNoUser = Would you like %1$S to save this password for %2$S?
+# LOCALIZATION NOTE (saveLoginMsg2, saveLoginMsgNoUser2):
+# %S is the login's hostname.
+saveLoginMsg2 = Save login for %S?
+saveLoginMsgNoUser2 = Save password for %S?
 saveLoginButtonAllow.label = Save
 saveLoginButtonAllow.accesskey = S
-saveLoginButtonDeny.label = Don’t Save
+saveLoginButtonDeny.label = Don’t save
 saveLoginButtonDeny.accesskey = D
-saveLoginButtonNever.label = Never Save
+saveLoginButtonNever.label = Never save
 saveLoginButtonNever.accesskey = e
-updateLoginMsg = Would you like to update this login?
-updateLoginMsgNoUser = Would you like to update this password?
-updateLoginMsgAddUsername = Would you like to add a username to the saved password?
+updateLoginMsg2 = Update this login?
+updateLoginMsgNoUser2 = Update this password?
+updateLoginMsgAddUsername2 = Add username to saved password?
 updateLoginButtonText = Update
 updateLoginButtonAccessKey = U
-updateLoginButtonDeny.label = Don’t Update
+updateLoginButtonDeny.label = Don’t update
 updateLoginButtonDeny.accesskey = D
-updateLoginButtonDelete.label = Remove Saved Login
+updateLoginButtonDelete.label = Remove saved login
 updateLoginButtonDelete.accesskey = R
 # LOCALIZATION NOTE (rememberPasswordMsg):
 # 1st string is the username for the login, 2nd is the login's hostname.
 # Note that long usernames may be truncated.
 rememberPasswordMsg = Would you like to remember the password for “%1$S” on %2$S?
 # LOCALIZATION NOTE (rememberPasswordMsgNoUsername):
 # String is the login's hostname.
 rememberPasswordMsgNoUsername = Would you like to remember the password on %S?