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."> ...@@ -7853,26 +7853,17 @@ the Bookmarks menu.">
</message> </message>
<!-- Account password storage reauth tab modal dialog --> <!-- 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."> <message name="IDS_ACCOUNT_PASSWORDS_REAUTH_TITLE" desc="Title of the account password storage reauth tab modal dialog.">
Save this and other passwords in your Google Account? Use your Google Account to save and fill passwords?
</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> </message>
<message name="IDS_ACCOUNT_PASSWORDS_REAUTH_DESC" desc="Body of the account password storage reauth tab modal dialog."> <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 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
</message> </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."> <message name="IDS_ACCOUNT_PASSWORDS_REAUTH_CONFIRM_BUTTON_LABEL" desc="Label of the confirmation button in the account password storage reauth tab modal dialog.">
Show Yes
</message> </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."> <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 No thanks
</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
</message> </message>
<message name="IDS_PLUGIN_OUTDATED_PROMPT" desc="Infobar message when an outdated plugin was disabled"> <message name="IDS_PLUGIN_OUTDATED_PROMPT" desc="Infobar message when an outdated plugin was disabled">
......
5c3bac7f7a6409b8916770f6604e1c3fd13bd8a5 5e146f2042d26ea36f0691767e3f7d28d10e96de
\ No newline at end of file \ No newline at end of file
8600966344b959251abb06a3f2f4a2df9f07806c 5e146f2042d26ea36f0691767e3f7d28d10e96de
\ No newline at end of file \ No newline at end of file
5c3bac7f7a6409b8916770f6604e1c3fd13bd8a5 5e146f2042d26ea36f0691767e3f7d28d10e96de
\ No newline at end of file \ 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 5e146f2042d26ea36f0691767e3f7d28d10e96de
\ No newline at end of file \ No newline at end of file
...@@ -17,7 +17,6 @@ js_library("signin_reauth_app") { ...@@ -17,7 +17,6 @@ js_library("signin_reauth_app") {
deps = [ deps = [
":signin_reauth_browser_proxy", ":signin_reauth_browser_proxy",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//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:load_time_data.m",
"//ui/webui/resources/js:web_ui_listener_behavior.m", "//ui/webui/resources/js:web_ui_listener_behavior.m",
] ]
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
</paper-spinner-lite> </paper-spinner-lite>
<cr-button id="confirmButton" class="action-button" on-click="onConfirm_" <cr-button id="confirmButton" class="action-button" on-click="onConfirm_"
hidden="[[confirmButtonHidden_]]" consent-confirmation> hidden="[[confirmButtonHidden_]]" consent-confirmation>
[[confirmButtonLabel_]] $i18n{signinReauthConfirmLabel}
</cr-button> </cr-button>
<cr-button id="cancelButton" on-click="onCancel_" <cr-button id="cancelButton" on-click="onCancel_"
hidden="[[cancelButtonHidden_]]"> hidden="[[cancelButtonHidden_]]">
......
...@@ -9,7 +9,6 @@ import './strings.m.js'; ...@@ -9,7 +9,6 @@ import './strings.m.js';
import './signin_shared_css.js'; import './signin_shared_css.js';
import {assert, assertNotReached} from 'chrome://resources/js/assert.m.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 {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
import {WebUIListenerBehavior} from 'chrome://resources/js/web_ui_listener_behavior.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'; import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';
...@@ -21,7 +20,7 @@ Polymer({ ...@@ -21,7 +20,7 @@ Polymer({
_template: html`{__html_template__}`, _template: html`{__html_template__}`,
behaviors: [I18nBehavior, WebUIListenerBehavior], behaviors: [WebUIListenerBehavior],
properties: { properties: {
/** @private */ /** @private */
...@@ -32,9 +31,6 @@ Polymer({ ...@@ -32,9 +31,6 @@ Polymer({
}, },
}, },
/** @private */
confirmButtonLabel_: String,
/** @private */ /** @private */
confirmButtonHidden_: {type: Boolean, value: true}, confirmButtonHidden_: {type: Boolean, value: true},
...@@ -76,10 +72,7 @@ Polymer({ ...@@ -76,10 +72,7 @@ Polymer({
onReauthTypeReceived_(requiresReauth) { onReauthTypeReceived_(requiresReauth) {
this.confirmButtonHidden_ = false; this.confirmButtonHidden_ = false;
this.$.confirmButton.focus(); this.$.confirmButton.focus();
this.cancelButtonHidden_ = requiresReauth; this.cancelButtonHidden_ = false;
this.confirmButtonLabel_ = requiresReauth ?
this.i18n('signinReauthNextLabel') :
this.i18n('signinReauthConfirmLabel');
}, },
/** @return {!Array<string>} Text of the consent description elements. */ /** @return {!Array<string>} Text of the consent description elements. */
......
...@@ -53,44 +53,11 @@ std::string GetAccountImageURL(Profile* profile) { ...@@ -53,44 +53,11 @@ std::string GetAccountImageURL(Profile* profile) {
: profiles::GetPlaceholderAvatarIconUrl(); : 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 } // namespace
SigninReauthUI::SigninReauthUI(content::WebUI* web_ui) SigninReauthUI::SigninReauthUI(content::WebUI* web_ui)
: SigninWebDialogUI(web_ui) { : SigninWebDialogUI(web_ui) {
Profile* profile = Profile::FromWebUI(web_ui); Profile* profile = Profile::FromWebUI(web_ui);
signin_metrics::ReauthAccessPoint access_point =
signin::GetReauthAccessPointForReauthConfirmationURL(
web_ui->GetWebContents()->GetVisibleURL());
content::WebUIDataSource* source = content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUISigninReauthHost); content::WebUIDataSource::Create(chrome::kChromeUISigninReauthHost);
source->UseStringsJs(); source->UseStringsJs();
...@@ -118,13 +85,11 @@ SigninReauthUI::SigninReauthUI(content::WebUI* web_ui) ...@@ -118,13 +85,11 @@ SigninReauthUI::SigninReauthUI(content::WebUI* web_ui)
"images/signin_reauth_illustration_dark.svg", "images/signin_reauth_illustration_dark.svg",
IDR_SIGNIN_REAUTH_IMAGES_ACCOUNT_PASSWORDS_REAUTH_ILLUSTRATION_DARK_SVG); IDR_SIGNIN_REAUTH_IMAGES_ACCOUNT_PASSWORDS_REAUTH_ILLUSTRATION_DARK_SVG);
AddStringResource(source, "signinReauthTitle", AddStringResource(source, "signinReauthTitle",
GetReauthTitleStringId(access_point)); IDS_ACCOUNT_PASSWORDS_REAUTH_TITLE);
AddStringResource(source, "signinReauthDesc", AddStringResource(source, "signinReauthDesc",
IDS_ACCOUNT_PASSWORDS_REAUTH_DESC); IDS_ACCOUNT_PASSWORDS_REAUTH_DESC);
AddStringResource(source, "signinReauthConfirmLabel", AddStringResource(source, "signinReauthConfirmLabel",
GetReauthConfirmButtonLabelStringId(access_point)); IDS_ACCOUNT_PASSWORDS_REAUTH_CONFIRM_BUTTON_LABEL);
AddStringResource(source, "signinReauthNextLabel",
IDS_ACCOUNT_PASSWORDS_REAUTH_NEXT_BUTTON_LABEL);
AddStringResource(source, "signinReauthCloseLabel", AddStringResource(source, "signinReauthCloseLabel",
IDS_ACCOUNT_PASSWORDS_REAUTH_CLOSE_BUTTON_LABEL); IDS_ACCOUNT_PASSWORDS_REAUTH_CLOSE_BUTTON_LABEL);
......
...@@ -38,7 +38,7 @@ suite('SigninReauthTest', function() { ...@@ -38,7 +38,7 @@ suite('SigninReauthTest', function() {
test('LoadPage', function() { test('LoadPage', function() {
assertDefaultLocale(); assertDefaultLocale();
assertEquals( assertEquals(
'Save this and other passwords in your Google Account?', 'Use your Google Account to save and fill passwords?',
app.$.signinReauthTitle.textContent.trim()); app.$.signinReauthTitle.textContent.trim());
}); });
...@@ -52,41 +52,33 @@ suite('SigninReauthTest', function() { ...@@ -52,41 +52,33 @@ suite('SigninReauthTest', function() {
return browserProxy.whenCalled('cancel'); return browserProxy.whenCalled('cancel');
}); });
test('RequiresReauth', async () => { const requires_reauth_test_params = [
await browserProxy.whenCalled('initialize'); {
assertFalse(isVisible(app.$.confirmButton)); requires_reauth: true,
assertFalse(isVisible(app.$.cancelButton)); },
assertTrue(isVisible(app.$$('paper-spinner-lite'))); {
requires_reauth: false,
webUIListenerCallback('reauth-type-received', true); },
flush(); ];
assertTrue(isVisible(app.$.confirmButton)); requires_reauth_test_params.forEach(function(params) {
assertFalse(isVisible(app.$.cancelButton)); test('ButtonsVisibilityAndFocus', async () => {
assertFalse(isVisible(app.$$('paper-spinner-lite'))); await browserProxy.whenCalled('initialize');
assertFalse(isVisible(app.$.confirmButton));
assertEquals(getDeepActiveElement(), app.$.confirmButton); assertFalse(isVisible(app.$.cancelButton));
assertTrue(isVisible(app.$$('paper-spinner-lite')));
assertDefaultLocale();
assertEquals('Next', app.$.confirmButton.textContent.trim()); webUIListenerCallback('reauth-type-received', params.requires_reauth);
}); flush();
test('DoesNotRequireReauth', async () => { assertTrue(isVisible(app.$.confirmButton));
await browserProxy.whenCalled('initialize'); assertTrue(isVisible(app.$.cancelButton));
assertFalse(isVisible(app.$.confirmButton)); assertFalse(isVisible(app.$$('paper-spinner-lite')));
assertFalse(isVisible(app.$.cancelButton));
assertTrue(isVisible(app.$$('paper-spinner-lite'))); assertEquals(getDeepActiveElement(), app.$.confirmButton);
webUIListenerCallback('reauth-type-received', false); assertDefaultLocale();
flush(); assertEquals('Yes', app.$.confirmButton.textContent.trim());
});
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());
}); });
}); });
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