Commit 0d0d97ae authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS Settings] Move and copy AddPrivacyStrings strings to OS settings

This CL moves Privacy Personalization strings from AddPrivacyStrings()
to the shared string provider, and moves strings from the function
that are OS exclusive from browser settings string provider to OS
settings strings provider.

Bug: 967888
Change-Id: I72c7b27a4e04a091ff347b420dde53ea7baf418d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2029329Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738045}
parent cc31ed12
...@@ -60,14 +60,15 @@ ...@@ -60,14 +60,15 @@
<if expr="_google_chrome"> <if expr="_google_chrome">
<if expr="chromeos"> <if expr="chromeos">
<settings-toggle-button pref="{{prefs.cros.metrics.reportingEnabled}}" <settings-toggle-button pref="{{prefs.cros.metrics.reportingEnabled}}"
label="$i18n{enableLogging}" label="$i18n{enablePersonalizationLogging}"
sub-label="$i18n{enableLoggingDesc}"> sub-label="$i18n{enablePersonalizationLoggingDesc}">
</settings-toggle-button> </settings-toggle-button>
</if><!-- chromeos --> </if><!-- chromeos -->
<if expr="not chromeos"> <if expr="not chromeos">
<settings-toggle-button id="metricsReportingControl" <settings-toggle-button id="metricsReportingControl"
pref="[[metricsReportingPref_]]" label="$i18n{enableLogging}" pref="[[metricsReportingPref_]]"
sub-label="$i18n{enableLoggingDesc}" no-set-pref label="$i18n{enablePersonalizationLogging}"
sub-label="$i18n{enablePersonalizationLoggingDesc}" no-set-pref
on-settings-boolean-control-change="onMetricsReportingChange_"> on-settings-boolean-control-change="onMetricsReportingChange_">
<template is="dom-if" if="[[showRestart_]]" restamp> <template is="dom-if" if="[[showRestart_]]" restamp>
<cr-button on-click="onRestartTap_" id="restart" <cr-button on-click="onRestartTap_" id="restart"
......
...@@ -1578,6 +1578,22 @@ void AddSearchStrings(content::WebUIDataSource* html_source, Profile* profile) { ...@@ -1578,6 +1578,22 @@ void AddSearchStrings(content::WebUIDataSource* html_source, Profile* profile) {
ui::SubstituteChromeOSDeviceType(IDS_OS_SETTINGS_SEARCH_ENGINE_TOOLTIP)); ui::SubstituteChromeOSDeviceType(IDS_OS_SETTINGS_SEARCH_ENGINE_TOOLTIP));
} }
void AddPrivacyStrings(content::WebUIDataSource* html_source) {
static constexpr webui::LocalizedString kLocalizedStrings[] = {
{"privacyPageTitle", IDS_SETTINGS_PRIVACY},
{"enableLogging", IDS_SETTINGS_ENABLE_LOGGING_PREF},
{"enableLoggingDesc", IDS_SETTINGS_ENABLE_LOGGING_PREF_DESC},
{"wakeOnWifi", IDS_SETTINGS_WAKE_ON_WIFI_DESCRIPTION},
{"enableContentProtectionAttestation",
IDS_SETTINGS_ENABLE_CONTENT_PROTECTION_ATTESTATION},
};
AddLocalizedStringsBulk(html_source, kLocalizedStrings);
html_source->AddString("syncAndGoogleServicesLearnMoreURL",
chrome::kSyncAndGoogleServicesLearnMoreURL);
::settings::AddPersonalizationOptionsStrings(html_source);
}
} // namespace } // namespace
void AddOsLocalizedStrings(content::WebUIDataSource* html_source, void AddOsLocalizedStrings(content::WebUIDataSource* html_source,
...@@ -1604,6 +1620,7 @@ void AddOsLocalizedStrings(content::WebUIDataSource* html_source, ...@@ -1604,6 +1620,7 @@ void AddOsLocalizedStrings(content::WebUIDataSource* html_source,
AddPersonalizationStrings(html_source); AddPersonalizationStrings(html_source);
AddPluginVmStrings(html_source, profile); AddPluginVmStrings(html_source, profile);
AddPrintingStrings(html_source); AddPrintingStrings(html_source);
AddPrivacyStrings(html_source);
AddResetStrings(html_source); AddResetStrings(html_source);
AddSearchInSettingsStrings(html_source); AddSearchInSettingsStrings(html_source);
AddSearchStrings(html_source, profile); AddSearchStrings(html_source, profile);
......
...@@ -1380,13 +1380,8 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source, ...@@ -1380,13 +1380,8 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source,
static constexpr webui::LocalizedString kLocalizedStrings[] = { static constexpr webui::LocalizedString kLocalizedStrings[] = {
{"privacyPageTitle", IDS_SETTINGS_PRIVACY}, {"privacyPageTitle", IDS_SETTINGS_PRIVACY},
{"privacyPageMore", IDS_SETTINGS_PRIVACY_MORE}, {"privacyPageMore", IDS_SETTINGS_PRIVACY_MORE},
{"signinAllowedTitle", IDS_SETTINGS_SIGNIN_ALLOWED},
{"signinAllowedDescription", IDS_SETTINGS_SIGNIN_ALLOWED_DESC},
{"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},
{"enableContentProtectionAttestation",
IDS_SETTINGS_ENABLE_CONTENT_PROTECTION_ATTESTATION},
{"wakeOnWifi", IDS_SETTINGS_WAKE_ON_WIFI_DESCRIPTION},
{"securityPageTitle", IDS_SETTINGS_SECURITY}, {"securityPageTitle", IDS_SETTINGS_SECURITY},
{"securityPageAdvancedSectionLabel", {"securityPageAdvancedSectionLabel",
IDS_SETTINGS_SECURITY_ADVANCED_SECTION_LABEL}, IDS_SETTINGS_SECURITY_ADVANCED_SECTION_LABEL},
...@@ -1415,28 +1410,12 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source, ...@@ -1415,28 +1410,12 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source,
{"safeBrowsingSectionLabel", IDS_SETTINGS_SAFEBROWSING_SECTION_LABEL}, {"safeBrowsingSectionLabel", IDS_SETTINGS_SAFEBROWSING_SECTION_LABEL},
{"syncAndGoogleServicesPrivacyDescription", {"syncAndGoogleServicesPrivacyDescription",
IDS_SETTINGS_SYNC_AND_GOOGLE_SERVICES_PRIVACY_DESC_UNIFIED_CONSENT}, IDS_SETTINGS_SYNC_AND_GOOGLE_SERVICES_PRIVACY_DESC_UNIFIED_CONSENT},
{"urlKeyedAnonymizedDataCollection",
IDS_SETTINGS_ENABLE_URL_KEYED_ANONYMIZED_DATA_COLLECTION},
{"urlKeyedAnonymizedDataCollectionDesc",
IDS_SETTINGS_ENABLE_URL_KEYED_ANONYMIZED_DATA_COLLECTION_DESC},
};
AddLocalizedStringsBulk(html_source, kLocalizedStrings);
static constexpr webui::LocalizedString kConditionalLocalizedStrings[] = {
{"searchSuggestPref", IDS_SETTINGS_SUGGEST_PREF},
{"searchSuggestPrefDesc", IDS_SETTINGS_SUGGEST_PREF_DESC},
{"networkPredictionEnabled", {"networkPredictionEnabled",
IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_LABEL}, IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_LABEL},
{"networkPredictionEnabledDesc", {"networkPredictionEnabledDesc",
IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_DESC}, IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_DESC},
{"linkDoctorPref", IDS_SETTINGS_LINKDOCTOR_PREF},
{"linkDoctorPrefDesc", IDS_SETTINGS_LINKDOCTOR_PREF_DESC},
{"spellingPref", IDS_SETTINGS_SPELLING_PREF},
{"spellingDescription", IDS_SETTINGS_SPELLING_PREF_DESC},
{"enableLogging", IDS_SETTINGS_ENABLE_LOGGING_PREF},
{"enableLoggingDesc", IDS_SETTINGS_ENABLE_LOGGING_PREF_DESC},
}; };
AddLocalizedStringsBulk(html_source, kConditionalLocalizedStrings); AddLocalizedStringsBulk(html_source, kLocalizedStrings);
html_source->AddString("syncAndGoogleServicesLearnMoreURL", html_source->AddString("syncAndGoogleServicesLearnMoreURL",
chrome::kSyncAndGoogleServicesLearnMoreURL); chrome::kSyncAndGoogleServicesLearnMoreURL);
...@@ -1455,6 +1434,8 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source, ...@@ -1455,6 +1434,8 @@ void AddPrivacyStrings(content::WebUIDataSource* html_source,
html_source->AddBoolean( html_source->AddBoolean(
"installedAppsInCbd", "installedAppsInCbd",
base::FeatureList::IsEnabled(features::kStoragePressureUI)); base::FeatureList::IsEnabled(features::kStoragePressureUI));
AddPersonalizationOptionsStrings(html_source);
} }
void AddSearchInSettingsStrings(content::WebUIDataSource* html_source) { void AddSearchInSettingsStrings(content::WebUIDataSource* html_source) {
......
...@@ -59,4 +59,26 @@ void AddCaptionSubpageStrings(content::WebUIDataSource* html_source) { ...@@ -59,4 +59,26 @@ void AddCaptionSubpageStrings(content::WebUIDataSource* html_source) {
AddLocalizedStringsBulk(html_source, kLocalizedStrings); AddLocalizedStringsBulk(html_source, kLocalizedStrings);
} }
void AddPersonalizationOptionsStrings(content::WebUIDataSource* html_source) {
static constexpr webui::LocalizedString kLocalizedStrings[] = {
{"urlKeyedAnonymizedDataCollection",
IDS_SETTINGS_ENABLE_URL_KEYED_ANONYMIZED_DATA_COLLECTION},
{"urlKeyedAnonymizedDataCollectionDesc",
IDS_SETTINGS_ENABLE_URL_KEYED_ANONYMIZED_DATA_COLLECTION_DESC},
{"spellingPref", IDS_SETTINGS_SPELLING_PREF},
#if !defined(OS_CHROMEOS)
{"signinAllowedTitle", IDS_SETTINGS_SIGNIN_ALLOWED},
{"signinAllowedDescription", IDS_SETTINGS_SIGNIN_ALLOWED_DESC},
#endif
{"searchSuggestPref", IDS_SETTINGS_SUGGEST_PREF},
{"enablePersonalizationLogging", IDS_SETTINGS_ENABLE_LOGGING_PREF},
{"enablePersonalizationLoggingDesc", IDS_SETTINGS_ENABLE_LOGGING_PREF_DESC},
{"spellingDescription", IDS_SETTINGS_SPELLING_PREF_DESC},
{"searchSuggestPrefDesc", IDS_SETTINGS_SUGGEST_PREF_DESC},
{"linkDoctorPref", IDS_SETTINGS_LINKDOCTOR_PREF},
{"linkDoctorPrefDesc", IDS_SETTINGS_LINKDOCTOR_PREF_DESC},
};
AddLocalizedStringsBulk(html_source, kLocalizedStrings);
}
} // namespace settings } // namespace settings
...@@ -14,6 +14,9 @@ namespace settings { ...@@ -14,6 +14,9 @@ namespace settings {
// Adds strings used by the <settings-captions> element. // Adds strings used by the <settings-captions> element.
void AddCaptionSubpageStrings(content::WebUIDataSource* html_source); void AddCaptionSubpageStrings(content::WebUIDataSource* html_source);
// Adds strings used by the <settings-personalization-options> element.
void AddPersonalizationOptionsStrings(content::WebUIDataSource* html_source);
} // namespace settings } // namespace settings
#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SHARED_SETTINGS_LOCALIZED_STRINGS_PROVIDER_H_ #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SHARED_SETTINGS_LOCALIZED_STRINGS_PROVIDER_H_
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