Commit a3363c95 authored by Martin Šrámek's avatar Martin Šrámek Committed by Commit Bot

Update the Site Settings and Password Leak Check toggle strings

The Site settings menu entrypoint returns to use the old "Site settings"
string. The new string resource which was previously added there can be
removed. We will remove it in a followup CL to make this CL safer to
merge:
https://chromium-review.googlesource.com/c/chromium/src/+/2108543

The Password leak check toggle currently has an explanatory string that
the feature only works for signed-in users, which only shows when the
user is signed out. When the user is signed in, there is no secondary
text. The design paradigm of privacy settings is that the secondary
text should always explain the privacy implications. Therefore, we're
adding existing explanatory string from the password leak check UI
under this toggle as well, in both signed in and signed out cases.

See mocks:
https://docs.google.com/presentation/d/1utofQR2FyZlTOOsUgYGi0SyPeVA3DxCDjHmaAuu0EIo/edit?ts=5dcf17c5#slide=id.g700853307c_2_104
https://docs.google.com/presentation/d/1utofQR2FyZlTOOsUgYGi0SyPeVA3DxCDjHmaAuu0EIo/edit?ts=5dcf17c5#slide=id.g710b7438a5_5_83

Bug: 1062607
Change-Id: I6f404d147e09ec71caf0d843f371d2c4bf774b38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108143
Commit-Queue: Martin Šrámek <msramek@chromium.org>
Reviewed-by: default avatarTheodore Olsauskas-Warren <sauski@google.com>
Reviewed-by: default avatardpapad <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751868}
parent 3455fe5f
...@@ -88,10 +88,20 @@ Polymer({ ...@@ -88,10 +88,20 @@ Polymer({
* @private * @private
*/ */
getPasswordsLeakDetectionSubLabel_() { getPasswordsLeakDetectionSubLabel_() {
let subLabel = this.i18n('passwordsLeakDetectionGeneralDescription');
if (!this.userSignedIn_ && this.passwordsLeakDetectionAvailable_) { if (!this.userSignedIn_ && this.passwordsLeakDetectionAvailable_) {
return this.i18n('passwordsLeakDetectionSignedOutEnabledDescription'); subLabel +=
' ' + // Whitespace is a valid sentence separator w.r.t. i18n.
this.i18n('passwordsLeakDetectionSignedOutEnabledDescription') +
// The string appended on the previous line was added as a standalone
// sentence that did not end with a period. Since here we're appending
// it to a two-sentence string, with both of those sentences ending
// with periods, we must add a period at the end.
// TODO(crbug.com/1032584): After the privacy settings redesign, this
// string will never appear standalone. Include the period in it.
this.i18n('sentenceEnd');
} }
return ''; return subLabel;
}, },
/** /**
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
sub-label="$i18n{securityPageDescription}" sub-label="$i18n{securityPageDescription}"
on-click="onSecurityPageClick_"></cr-link-row> on-click="onSecurityPageClick_"></cr-link-row>
<cr-link-row id="permissionsLinkRow" start-icon="settings:permissions" <cr-link-row id="permissionsLinkRow" start-icon="settings:permissions"
class="hr" label="$i18n{permissionsPageTitle}" class="hr" label="$i18n{siteSettings}"
sub-label="$i18n{permissionsPageDescription}" sub-label="$i18n{permissionsPageDescription}"
on-click="onPermissionsPageClick_"></cr-link-row> on-click="onPermissionsPageClick_"></cr-link-row>
</template> </template>
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
#include "ui/base/accelerators/accelerator.h" #include "ui/base/accelerators/accelerator.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/base/webui/web_ui_util.h" #include "ui/base/webui/web_ui_util.h"
#include "ui/strings/grit/ui_strings.h"
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "ash/public/cpp/ash_switches.h" #include "ash/public/cpp/ash_switches.h"
...@@ -155,6 +156,7 @@ void AddCommonStrings(content::WebUIDataSource* html_source, Profile* profile) { ...@@ -155,6 +156,7 @@ void AddCommonStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"save", IDS_SAVE}, {"save", IDS_SAVE},
{"searchResultBubbleText", IDS_SEARCH_RESULT_BUBBLE_TEXT}, {"searchResultBubbleText", IDS_SEARCH_RESULT_BUBBLE_TEXT},
{"searchResultsBubbleText", IDS_SEARCH_RESULTS_BUBBLE_TEXT}, {"searchResultsBubbleText", IDS_SEARCH_RESULTS_BUBBLE_TEXT},
{"sentenceEnd", IDS_SENTENCE_END},
{"settings", IDS_SETTINGS_SETTINGS}, {"settings", IDS_SETTINGS_SETTINGS},
{"settingsAltPageTitle", IDS_SETTINGS_ALT_PAGE_TITLE}, {"settingsAltPageTitle", IDS_SETTINGS_ALT_PAGE_TITLE},
{"subpageArrowRoleDescription", IDS_SETTINGS_SUBPAGE_BUTTON}, {"subpageArrowRoleDescription", IDS_SETTINGS_SUBPAGE_BUTTON},
...@@ -821,6 +823,8 @@ void AddAutofillStrings(content::WebUIDataSource* html_source, ...@@ -821,6 +823,8 @@ void AddAutofillStrings(content::WebUIDataSource* html_source,
IDS_SETTINGS_PASSWORDS_AUTOSIGNIN_CHECKBOX_DESC}, IDS_SETTINGS_PASSWORDS_AUTOSIGNIN_CHECKBOX_DESC},
{"passwordsLeakDetectionLabel", {"passwordsLeakDetectionLabel",
IDS_SETTINGS_PASSWORDS_LEAK_DETECTION_LABEL}, IDS_SETTINGS_PASSWORDS_LEAK_DETECTION_LABEL},
{"passwordsLeakDetectionGeneralDescription",
IDS_PASSWORD_MANAGER_LEAK_HELP_MESSAGE},
{"passwordsLeakDetectionSignedOutEnabledDescription", {"passwordsLeakDetectionSignedOutEnabledDescription",
IDS_SETTINGS_PASSWORDS_LEAK_DETECTION_SIGNED_OUT_ENABLED_DESC}, IDS_SETTINGS_PASSWORDS_LEAK_DETECTION_SIGNED_OUT_ENABLED_DESC},
{"savedPasswordsHeading", IDS_SETTINGS_PASSWORDS_SAVED_HEADING}, {"savedPasswordsHeading", IDS_SETTINGS_PASSWORDS_SAVED_HEADING},
...@@ -1072,6 +1076,7 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source, ...@@ -1072,6 +1076,7 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source,
{"privacyPageMore", IDS_SETTINGS_PRIVACY_MORE}, {"privacyPageMore", IDS_SETTINGS_PRIVACY_MORE},
{"doNotTrack", IDS_SETTINGS_ENABLE_DO_NOT_TRACK}, {"doNotTrack", IDS_SETTINGS_ENABLE_DO_NOT_TRACK},
{"doNotTrackDialogTitle", IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TITLE}, {"doNotTrackDialogTitle", IDS_SETTINGS_ENABLE_DO_NOT_TRACK_DIALOG_TITLE},
// TODO(crbug.com/1062607): This string is no longer used. Remove.
{"permissionsPageTitle", IDS_SETTINGS_PERMISSIONS}, {"permissionsPageTitle", IDS_SETTINGS_PERMISSIONS},
{"permissionsPageDescription", IDS_SETTINGS_PERMISSIONS_DESCRIPTION}, {"permissionsPageDescription", IDS_SETTINGS_PERMISSIONS_DESCRIPTION},
{"securityPageTitle", IDS_SETTINGS_SECURITY}, {"securityPageTitle", IDS_SETTINGS_SECURITY},
......
...@@ -15,6 +15,23 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() { ...@@ -15,6 +15,23 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() {
/** @type {SettingsPersonalizationOptionsElement} */ /** @type {SettingsPersonalizationOptionsElement} */
let testElement; let testElement;
/** @type {String} */
let signedInSubLabel;
/** @type {String} */
let signedOutSubLabel;
suiteSetup(function() {
signedInSubLabel =
loadTimeData.getString('passwordsLeakDetectionGeneralDescription');
signedOutSubLabel =
loadTimeData.getString('passwordsLeakDetectionGeneralDescription') +
' ' +
loadTimeData.getString(
'passwordsLeakDetectionSignedOutEnabledDescription') +
loadTimeData.getString('sentenceEnd');
});
setup(function() { setup(function() {
privacyPageBrowserProxy = new TestPrivacyPageBrowserProxy(); privacyPageBrowserProxy = new TestPrivacyPageBrowserProxy();
settings.PrivacyPageBrowserProxyImpl.instance_ = privacyPageBrowserProxy; settings.PrivacyPageBrowserProxyImpl.instance_ = privacyPageBrowserProxy;
...@@ -63,7 +80,9 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() { ...@@ -63,7 +80,9 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() {
assertTrue(testElement.$.passwordsLeakDetectionCheckbox.disabled); assertTrue(testElement.$.passwordsLeakDetectionCheckbox.disabled);
assertFalse(testElement.$.passwordsLeakDetectionCheckbox.checked); assertFalse(testElement.$.passwordsLeakDetectionCheckbox.checked);
assertEquals('', testElement.$.passwordsLeakDetectionCheckbox.subLabel); assertEquals(
signedInSubLabel,
testElement.$.passwordsLeakDetectionCheckbox.subLabel);
}); });
test('leakDetectionToggleSignedOutWithTruePref', function() { test('leakDetectionToggleSignedOutWithTruePref', function() {
...@@ -73,8 +92,7 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() { ...@@ -73,8 +92,7 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() {
assertTrue(testElement.$.passwordsLeakDetectionCheckbox.disabled); assertTrue(testElement.$.passwordsLeakDetectionCheckbox.disabled);
assertFalse(testElement.$.passwordsLeakDetectionCheckbox.checked); assertFalse(testElement.$.passwordsLeakDetectionCheckbox.checked);
assertEquals( assertEquals(
loadTimeData.getString( signedOutSubLabel,
'passwordsLeakDetectionSignedOutEnabledDescription'),
testElement.$.passwordsLeakDetectionCheckbox.subLabel); testElement.$.passwordsLeakDetectionCheckbox.subLabel);
}); });
...@@ -94,7 +112,9 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() { ...@@ -94,7 +112,9 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() {
assertFalse(testElement.$.passwordsLeakDetectionCheckbox.disabled); assertFalse(testElement.$.passwordsLeakDetectionCheckbox.disabled);
assertFalse(testElement.$.passwordsLeakDetectionCheckbox.checked); assertFalse(testElement.$.passwordsLeakDetectionCheckbox.checked);
assertEquals('', testElement.$.passwordsLeakDetectionCheckbox.subLabel); assertEquals(
signedInSubLabel,
testElement.$.passwordsLeakDetectionCheckbox.subLabel);
}); });
test('leakDetectionToggleSignedInNotSyncingWithTruePref', function() { test('leakDetectionToggleSignedInNotSyncingWithTruePref', function() {
...@@ -110,7 +130,9 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() { ...@@ -110,7 +130,9 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() {
assertFalse(testElement.$.passwordsLeakDetectionCheckbox.disabled); assertFalse(testElement.$.passwordsLeakDetectionCheckbox.disabled);
assertTrue(testElement.$.passwordsLeakDetectionCheckbox.checked); assertTrue(testElement.$.passwordsLeakDetectionCheckbox.checked);
assertEquals('', testElement.$.passwordsLeakDetectionCheckbox.subLabel); assertEquals(
signedInSubLabel,
testElement.$.passwordsLeakDetectionCheckbox.subLabel);
}); });
} }
...@@ -122,7 +144,9 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() { ...@@ -122,7 +144,9 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() {
assertFalse(testElement.$.passwordsLeakDetectionCheckbox.disabled); assertFalse(testElement.$.passwordsLeakDetectionCheckbox.disabled);
assertFalse(testElement.$.passwordsLeakDetectionCheckbox.checked); assertFalse(testElement.$.passwordsLeakDetectionCheckbox.checked);
assertEquals('', testElement.$.passwordsLeakDetectionCheckbox.subLabel); assertEquals(
signedInSubLabel,
testElement.$.passwordsLeakDetectionCheckbox.subLabel);
}); });
test('leakDetectionToggleSignedInAndSyncingWithTruePref', function() { test('leakDetectionToggleSignedInAndSyncingWithTruePref', function() {
...@@ -131,6 +155,8 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() { ...@@ -131,6 +155,8 @@ suite('CrSettingsPasswordsLeakDetectionToggleTest', function() {
assertFalse(testElement.$.passwordsLeakDetectionCheckbox.disabled); assertFalse(testElement.$.passwordsLeakDetectionCheckbox.disabled);
assertTrue(testElement.$.passwordsLeakDetectionCheckbox.checked); assertTrue(testElement.$.passwordsLeakDetectionCheckbox.checked);
assertEquals('', testElement.$.passwordsLeakDetectionCheckbox.subLabel); assertEquals(
signedInSubLabel,
testElement.$.passwordsLeakDetectionCheckbox.subLabel);
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment