Commit 9a044a93 authored by Alex Ilin's avatar Alex Ilin Committed by Commit Bot

[signin] Update strings in the reauth confirmation dialog

Bug: 1098677
Change-Id: Ie917e14b4d6caaf9d60cf61dcd3859c94fbbd59d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362930
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799574}
parent c4cc2a8d
......@@ -7853,26 +7853,17 @@ the Bookmarks menu.">
</message>
<!-- Account password storage reauth tab modal dialog -->
<message name="IDS_ACCOUNT_PASSWORDS_REAUTH_SAVE_TITLE" desc="Title of the account password storage reauth tab modal dialog. The dialog was shown because the user requested to save a password to their Google account.">
Save this and other passwords in your Google Account?
</message>
<message name="IDS_ACCOUNT_PASSWORDS_REAUTH_SHOW_TITLE" desc="Title of the account password storage reauth tab modal dialog. The dialog was shown because the user requested to get passwords from their Google account.">
Show passwords from your Google Account
<message name="IDS_ACCOUNT_PASSWORDS_REAUTH_TITLE" desc="Title of the account password storage reauth tab modal dialog.">
Use your Google Account to save and fill passwords?
</message>
<message name="IDS_ACCOUNT_PASSWORDS_REAUTH_DESC" desc="Body of the account password storage reauth tab modal dialog.">
Your passwords from your Google Account will also be available on this device while you're signed in
</message>
<message name="IDS_ACCOUNT_PASSWORDS_REAUTH_SAVE_BUTTON_LABEL" desc="Label of the confirmation button in the account password storage reauth tab modal dialog. The dialog was shown because the user requested to save a password to their Google account.">
Save
Passwords from your Google Account will also be available on this device while you're signed in
</message>
<message name="IDS_ACCOUNT_PASSWORDS_REAUTH_SHOW_BUTTON_LABEL" desc="Label of the confirmation button in the account password storage reauth tab modal dialog. The dialog was shown because the user requested to get passwords from their Google account.">
Show
<message name="IDS_ACCOUNT_PASSWORDS_REAUTH_CONFIRM_BUTTON_LABEL" desc="Label of the confirmation button in the account password storage reauth tab modal dialog.">
Yes
</message>
<message name="IDS_ACCOUNT_PASSWORDS_REAUTH_CLOSE_BUTTON_LABEL" desc="Label of the close button in the account password storage reauth tab modal dialog.">
Cancel
</message>
<message name="IDS_ACCOUNT_PASSWORDS_REAUTH_NEXT_BUTTON_LABEL" desc="Label of the next button in the account password storage reauth tab modal dialog. This button invites the user to authenticate to unlock the account password storage.">
Next
No thanks
</message>
<message name="IDS_PLUGIN_OUTDATED_PROMPT" desc="Infobar message when an outdated plugin was disabled">
......
5c3bac7f7a6409b8916770f6604e1c3fd13bd8a5
\ No newline at end of file
5e146f2042d26ea36f0691767e3f7d28d10e96de
\ No newline at end of file
8600966344b959251abb06a3f2f4a2df9f07806c
\ No newline at end of file
5e146f2042d26ea36f0691767e3f7d28d10e96de
\ No newline at end of file
5c3bac7f7a6409b8916770f6604e1c3fd13bd8a5
\ No newline at end of file
5e146f2042d26ea36f0691767e3f7d28d10e96de
\ No newline at end of file
5d949e5b40e238692e6a12ed95ed43f59a27ecad
\ No newline at end of file
5c3bac7f7a6409b8916770f6604e1c3fd13bd8a5
\ No newline at end of file
5c3bac7f7a6409b8916770f6604e1c3fd13bd8a5
\ No newline at end of file
a9e352937c1dced585b1244ad469f3ff1dedf106
\ No newline at end of file
a9e352937c1dced585b1244ad469f3ff1dedf106
\ No newline at end of file
8600966344b959251abb06a3f2f4a2df9f07806c
\ No newline at end of file
5e146f2042d26ea36f0691767e3f7d28d10e96de
\ No newline at end of file
......@@ -17,7 +17,6 @@ js_library("signin_reauth_app") {
deps = [
":signin_reauth_browser_proxy",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/js:i18n_behavior.m",
"//ui/webui/resources/js:load_time_data.m",
"//ui/webui/resources/js:web_ui_listener_behavior.m",
]
......
......@@ -86,7 +86,7 @@
</paper-spinner-lite>
<cr-button id="confirmButton" class="action-button" on-click="onConfirm_"
hidden="[[confirmButtonHidden_]]" consent-confirmation>
[[confirmButtonLabel_]]
$i18n{signinReauthConfirmLabel}
</cr-button>
<cr-button id="cancelButton" on-click="onCancel_"
hidden="[[cancelButtonHidden_]]">
......
......@@ -9,7 +9,6 @@ import './strings.m.js';
import './signin_shared_css.js';
import {assert, assertNotReached} from 'chrome://resources/js/assert.m.js';
import {I18nBehavior} from 'chrome://resources/js/i18n_behavior.m.js';
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.m.js';
import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
......@@ -21,7 +20,7 @@ Polymer({
_template: html`{__html_template__}`,
behaviors: [I18nBehavior, WebUIListenerBehavior],
behaviors: [WebUIListenerBehavior],
properties: {
/** @private */
......@@ -32,9 +31,6 @@ Polymer({
},
},
/** @private */
confirmButtonLabel_: String,
/** @private */
confirmButtonHidden_: {type: Boolean, value: true},
......@@ -76,10 +72,7 @@ Polymer({
onReauthTypeReceived_(requiresReauth) {
this.confirmButtonHidden_ = false;
this.$.confirmButton.focus();
this.cancelButtonHidden_ = requiresReauth;
this.confirmButtonLabel_ = requiresReauth ?
this.i18n('signinReauthNextLabel') :
this.i18n('signinReauthConfirmLabel');
this.cancelButtonHidden_ = false;
},
/** @return {!Array<string>} Text of the consent description elements. */
......
......@@ -53,44 +53,11 @@ std::string GetAccountImageURL(Profile* profile) {
: profiles::GetPlaceholderAvatarIconUrl();
}
int GetReauthTitleStringId(signin_metrics::ReauthAccessPoint access_point) {
switch (access_point) {
case signin_metrics::ReauthAccessPoint::kUnknown:
case signin_metrics::ReauthAccessPoint::kAutofillDropdown:
case signin_metrics::ReauthAccessPoint::kPasswordSettings:
return IDS_ACCOUNT_PASSWORDS_REAUTH_SHOW_TITLE;
case signin_metrics::ReauthAccessPoint::kGeneratePasswordDropdown:
case signin_metrics::ReauthAccessPoint::kGeneratePasswordContextMenu:
case signin_metrics::ReauthAccessPoint::kPasswordSaveBubble:
case signin_metrics::ReauthAccessPoint::kPasswordMoveBubble:
return IDS_ACCOUNT_PASSWORDS_REAUTH_SAVE_TITLE;
}
}
int GetReauthConfirmButtonLabelStringId(
signin_metrics::ReauthAccessPoint access_point) {
switch (access_point) {
case signin_metrics::ReauthAccessPoint::kUnknown:
case signin_metrics::ReauthAccessPoint::kAutofillDropdown:
case signin_metrics::ReauthAccessPoint::kPasswordSettings:
return IDS_ACCOUNT_PASSWORDS_REAUTH_SHOW_BUTTON_LABEL;
case signin_metrics::ReauthAccessPoint::kGeneratePasswordDropdown:
case signin_metrics::ReauthAccessPoint::kGeneratePasswordContextMenu:
case signin_metrics::ReauthAccessPoint::kPasswordSaveBubble:
case signin_metrics::ReauthAccessPoint::kPasswordMoveBubble:
return IDS_ACCOUNT_PASSWORDS_REAUTH_SAVE_BUTTON_LABEL;
}
}
} // namespace
SigninReauthUI::SigninReauthUI(content::WebUI* web_ui)
: SigninWebDialogUI(web_ui) {
Profile* profile = Profile::FromWebUI(web_ui);
signin_metrics::ReauthAccessPoint access_point =
signin::GetReauthAccessPointForReauthConfirmationURL(
web_ui->GetWebContents()->GetVisibleURL());
content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUISigninReauthHost);
source->UseStringsJs();
......@@ -118,13 +85,11 @@ SigninReauthUI::SigninReauthUI(content::WebUI* web_ui)
"images/signin_reauth_illustration_dark.svg",
IDR_SIGNIN_REAUTH_IMAGES_ACCOUNT_PASSWORDS_REAUTH_ILLUSTRATION_DARK_SVG);
AddStringResource(source, "signinReauthTitle",
GetReauthTitleStringId(access_point));
IDS_ACCOUNT_PASSWORDS_REAUTH_TITLE);
AddStringResource(source, "signinReauthDesc",
IDS_ACCOUNT_PASSWORDS_REAUTH_DESC);
AddStringResource(source, "signinReauthConfirmLabel",
GetReauthConfirmButtonLabelStringId(access_point));
AddStringResource(source, "signinReauthNextLabel",
IDS_ACCOUNT_PASSWORDS_REAUTH_NEXT_BUTTON_LABEL);
IDS_ACCOUNT_PASSWORDS_REAUTH_CONFIRM_BUTTON_LABEL);
AddStringResource(source, "signinReauthCloseLabel",
IDS_ACCOUNT_PASSWORDS_REAUTH_CLOSE_BUTTON_LABEL);
......
......@@ -38,7 +38,7 @@ suite('SigninReauthTest', function() {
test('LoadPage', function() {
assertDefaultLocale();
assertEquals(
'Save this and other passwords in your Google Account?',
'Use your Google Account to save and fill passwords?',
app.$.signinReauthTitle.textContent.trim());
});
......@@ -52,41 +52,33 @@ suite('SigninReauthTest', function() {
return browserProxy.whenCalled('cancel');
});
test('RequiresReauth', async () => {
await browserProxy.whenCalled('initialize');
assertFalse(isVisible(app.$.confirmButton));
assertFalse(isVisible(app.$.cancelButton));
assertTrue(isVisible(app.$$('paper-spinner-lite')));
webUIListenerCallback('reauth-type-received', true);
flush();
assertTrue(isVisible(app.$.confirmButton));
assertFalse(isVisible(app.$.cancelButton));
assertFalse(isVisible(app.$$('paper-spinner-lite')));
assertEquals(getDeepActiveElement(), app.$.confirmButton);
assertDefaultLocale();
assertEquals('Next', app.$.confirmButton.textContent.trim());
});
test('DoesNotRequireReauth', async () => {
await browserProxy.whenCalled('initialize');
assertFalse(isVisible(app.$.confirmButton));
assertFalse(isVisible(app.$.cancelButton));
assertTrue(isVisible(app.$$('paper-spinner-lite')));
webUIListenerCallback('reauth-type-received', false);
flush();
assertTrue(isVisible(app.$.confirmButton));
assertTrue(isVisible(app.$.cancelButton));
assertFalse(isVisible(app.$$('paper-spinner-lite')));
assertEquals(getDeepActiveElement(), app.$.confirmButton);
assertDefaultLocale();
assertEquals('Save', app.$.confirmButton.textContent.trim());
const requires_reauth_test_params = [
{
requires_reauth: true,
},
{
requires_reauth: false,
},
];
requires_reauth_test_params.forEach(function(params) {
test('ButtonsVisibilityAndFocus', async () => {
await browserProxy.whenCalled('initialize');
assertFalse(isVisible(app.$.confirmButton));
assertFalse(isVisible(app.$.cancelButton));
assertTrue(isVisible(app.$$('paper-spinner-lite')));
webUIListenerCallback('reauth-type-received', params.requires_reauth);
flush();
assertTrue(isVisible(app.$.confirmButton));
assertTrue(isVisible(app.$.cancelButton));
assertFalse(isVisible(app.$$('paper-spinner-lite')));
assertEquals(getDeepActiveElement(), app.$.confirmButton);
assertDefaultLocale();
assertEquals('Yes', app.$.confirmButton.textContent.trim());
});
});
});
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