Commit b5bd0713 authored by Sébastien Séguin-Gagnon's avatar Sébastien Séguin-Gagnon Committed by Commit Bot

[AF] Add cross-link to Privacy settings page in Payments settings page.

Bug: 905114
Change-Id: Ib8300998f6f183d7ffd0378ada0fbf02f118b9a2
Reviewed-on: https://chromium-review.googlesource.com/c/1308769Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609311}
parent 86b9c6a7
...@@ -752,6 +752,9 @@ ...@@ -752,6 +752,9 @@
<message name="IDS_SETTINGS_CREDIT_CARD_EXPIRED" desc="The error message that is shown when user attempts to enter or save an expired card."> <message name="IDS_SETTINGS_CREDIT_CARD_EXPIRED" desc="The error message that is shown when user attempts to enter or save an expired card.">
Your card is expired Your card is expired
</message> </message>
<message name="IDS_SETTINGS_PAYMENTS_PAGE_PRIVACY_LINK_TEXT" desc="The link text of the cross-link to the privacy settings page.">
To save payment methods to this device only, add them on this page, or visit <ph name="BEGIN_LINK_CHROMIUM">&lt;a target="_blank" href="$1"&gt;</ph>Privacy &amp; Security settings<ph name="END_LINK_CHROMIUM">&lt;/a&gt;</ph> and turn off the setting "Allow Chrome sign-in"
</message>
<message name="IDS_SETTINGS_PASSWORDS" desc="Name for the password section and toggle"> <message name="IDS_SETTINGS_PASSWORDS" desc="Name for the password section and toggle">
Manage passwords Manage passwords
</message> </message>
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
} }
</style> </style>
<settings-toggle-button id="autofillCreditCardToggle" <settings-toggle-button id="autofillCreditCardToggle"
class="settings-box first" class="settings-box first list-item"
aria-label="$i18n{creditCards}" no-extension-indicator aria-label="$i18n{creditCards}" no-extension-indicator
label="$i18n{enableCreditCardsLabel}" label="$i18n{enableCreditCardsLabel}"
sub-label="$i18n{enableCreditCardsSublabel}" sub-label="$i18n{enableCreditCardsSublabel}"
...@@ -61,6 +61,12 @@ ...@@ -61,6 +61,12 @@
</extension-controlled-indicator> </extension-controlled-indicator>
</div> </div>
</template> </template>
<div class="settings-box list-item underbar" id="paymentsPagePrivacyLink"
hidden$="[[!showPaymentsPagePrivacyLinkText_]]">
<div>$i18nRaw{paymentsPagePrivacyLinkText}</div>
</div>
<div class="settings-box continuation"> <div class="settings-box continuation">
<h2 class="start">$i18n{creditCards}</h2> <h2 class="start">$i18n{creditCards}</h2>
<paper-button id="addCreditCard" <paper-button id="addCreditCard"
......
...@@ -204,6 +204,18 @@ Polymer({ ...@@ -204,6 +204,18 @@ Polymer({
}, },
readOnly: true, readOnly: true,
}, },
/**
* True when the payments privacy page link should be shown.
* @private {boolean}
*/
showPaymentsPagePrivacyLinkText_: {
type: Boolean,
value: function() {
return loadTimeData.getBoolean('showPaymentsPagePrivacyLinkText');
},
readOnly: true,
},
}, },
listeners: { listeners: {
......
...@@ -1897,6 +1897,16 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) { ...@@ -1897,6 +1897,16 @@ void AddPeopleStrings(content::WebUIDataSource* html_source, Profile* profile) {
html_source->AddBoolean("isAccountManagerEnabled", html_source->AddBoolean("isAccountManagerEnabled",
chromeos::switches::IsAccountManagerEnabled()); chromeos::switches::IsAccountManagerEnabled());
#endif #endif
base::string16 payment_privacy_cross_link = l10n_util::GetStringFUTF16(
IDS_SETTINGS_PAYMENTS_PAGE_PRIVACY_LINK_TEXT,
base::ASCIIToUTF16(autofill::kPrivacySettingsURL));
html_source->AddString("paymentsPagePrivacyLinkText",
payment_privacy_cross_link);
html_source->AddBoolean(
"showPaymentsPagePrivacyLinkText",
base::FeatureList::IsEnabled(
autofill::features::kAutofillEnableAccountWalletStorage));
} }
void AddPrintingStrings(content::WebUIDataSource* html_source) { void AddPrintingStrings(content::WebUIDataSource* html_source) {
......
...@@ -618,5 +618,19 @@ cr.define('settings_payments_section', function() { ...@@ -618,5 +618,19 @@ cr.define('settings_payments_section', function() {
// All migration requirements are met, verify migration button is shown. // All migration requirements are met, verify migration button is shown.
assertFalse(section.$$('#migrateCreditCards').hidden); assertFalse(section.$$('#migrateCreditCards').hidden);
}); });
test('verifyPrivacyLinkHidden', function() {
// By default, the link should not be visible.
const section = createPaymentsSection([], {});
assertTrue(section.$$('#paymentsPagePrivacyLink').hidden);
});
test('verifyPrivacyLinkVisible', function() {
loadTimeData.overrideValues({showPaymentsPagePrivacyLinkText: true});
const section = createPaymentsSection([], {});
assertFalse(section.$$('#paymentsPagePrivacyLink').hidden);
});
}); });
}); });
...@@ -18,6 +18,8 @@ const char kHelpURL[] = ...@@ -18,6 +18,8 @@ const char kHelpURL[] =
const char kSettingsOrigin[] = "Chrome settings"; const char kSettingsOrigin[] = "Chrome settings";
const char kPrivacySettingsURL[] = "chrome://settings/privacy";
size_t MinRequiredFieldsForHeuristics() { size_t MinRequiredFieldsForHeuristics() {
return base::FeatureList::IsEnabled( return base::FeatureList::IsEnabled(
autofill::features::kAutofillEnforceMinRequiredFieldsForHeuristics) autofill::features::kAutofillEnforceMinRequiredFieldsForHeuristics)
......
...@@ -17,6 +17,9 @@ extern const char kHelpURL[]; ...@@ -17,6 +17,9 @@ extern const char kHelpURL[];
// The origin of an AutofillDataModel created or modified in the settings page. // The origin of an AutofillDataModel created or modified in the settings page.
extern const char kSettingsOrigin[]; extern const char kSettingsOrigin[];
// The privacy page URL of the chrome settings.
extern const char kPrivacySettingsURL[];
// The number of fields required by Autofill to execute its heuristic and // The number of fields required by Autofill to execute its heuristic and
// crowd-sourcing query/upload routines. // crowd-sourcing query/upload routines.
size_t MinRequiredFieldsForHeuristics(); size_t MinRequiredFieldsForHeuristics();
......
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