Commit cdeae011 authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS Settings] Add needed OS strings and remove browser string provider

This CL copies over the final strings that are missing from browser
settings to OS settings, and removes the browser string provider from
OS settings.

Bug: 967888
Change-Id: Iebf0880fb3ef94df67e9bc4fea14ad286b0c18ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036263
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738408}
parent 8bffdd2e
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.h" #include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.h"
#include "chrome/browser/ui/webui/chromeos/smb_shares/smb_shares_localized_strings_provider.h" #include "chrome/browser/ui/webui/chromeos/smb_shares/smb_shares_localized_strings_provider.h"
#include "chrome/browser/ui/webui/management_ui.h" #include "chrome/browser/ui/webui/management_ui.h"
#include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h"
#include "chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.h" #include "chrome/browser/ui/webui/settings/shared_settings_localized_strings_provider.h"
#include "chrome/browser/ui/webui/webui_util.h" #include "chrome/browser/ui/webui/webui_util.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
...@@ -97,6 +98,7 @@ void AddCommonStrings(content::WebUIDataSource* html_source, Profile* profile) { ...@@ -97,6 +98,7 @@ void AddCommonStrings(content::WebUIDataSource* html_source, Profile* profile) {
{"close", IDS_CLOSE}, {"close", IDS_CLOSE},
{"confirm", IDS_CONFIRM}, {"confirm", IDS_CONFIRM},
{"continue", IDS_SETTINGS_CONTINUE}, {"continue", IDS_SETTINGS_CONTINUE},
{"controlledByExtension", IDS_SETTINGS_CONTROLLED_BY_EXTENSION},
{"custom", IDS_SETTINGS_CUSTOM}, {"custom", IDS_SETTINGS_CUSTOM},
{"delete", IDS_SETTINGS_DELETE}, {"delete", IDS_SETTINGS_DELETE},
{"deviceOff", IDS_SETTINGS_DEVICE_OFF}, {"deviceOff", IDS_SETTINGS_DEVICE_OFF},
...@@ -367,6 +369,10 @@ void AddLanguagesStrings(content::WebUIDataSource* html_source) { ...@@ -367,6 +369,10 @@ void AddLanguagesStrings(content::WebUIDataSource* html_source) {
{"moveUp", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_MOVE_UP}, {"moveUp", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_MOVE_UP},
}; };
AddLocalizedStringsBulk(html_source, kLocalizedStrings); AddLocalizedStringsBulk(html_source, kLocalizedStrings);
html_source->AddString(
"languagesLearnMoreURL",
base::ASCIIToUTF16(chrome::kLanguageSettingsLearnMoreUrl));
} }
void AddPersonalizationStrings(content::WebUIDataSource* html_source) { void AddPersonalizationStrings(content::WebUIDataSource* html_source) {
...@@ -812,6 +818,9 @@ void AddChromeOSUserStrings(content::WebUIDataSource* html_source, ...@@ -812,6 +818,9 @@ void AddChromeOSUserStrings(content::WebUIDataSource* html_source,
base::ASCIIToUTF16(chrome::kChromeUISettingsURL))); base::ASCIIToUTF16(chrome::kChromeUISettingsURL)));
html_source->AddBoolean("isActiveDirectoryUser", html_source->AddBoolean("isActiveDirectoryUser",
user && user->IsActiveDirectoryUser()); user && user->IsActiveDirectoryUser());
html_source->AddBoolean(
"isSecondaryUser",
user && user->GetAccountId() != primary_user->GetAccountId());
html_source->AddString( html_source->AddString(
"secondaryUserBannerText", "secondaryUserBannerText",
l10n_util::GetStringFUTF16(IDS_SETTINGS_SECONDARY_USER_BANNER, l10n_util::GetStringFUTF16(IDS_SETTINGS_SECONDARY_USER_BANNER,
...@@ -2003,6 +2012,10 @@ void AddOsLocalizedStrings(content::WebUIDataSource* html_source, ...@@ -2003,6 +2012,10 @@ void AddOsLocalizedStrings(content::WebUIDataSource* html_source,
AddSearchInSettingsStrings(html_source); AddSearchInSettingsStrings(html_source);
AddSearchStrings(html_source, profile); AddSearchStrings(html_source, profile);
AddUsersStrings(html_source); AddUsersStrings(html_source);
policy_indicator::AddLocalizedStrings(html_source);
html_source->UseStringsJs();
} }
} // namespace settings } // namespace settings
......
...@@ -216,11 +216,6 @@ OSSettingsUI::OSSettingsUI(content::WebUI* web_ui) ...@@ -216,11 +216,6 @@ OSSettingsUI::OSSettingsUI(content::WebUI* web_ui)
html_source->AddResourcePath("app-management/image_info.mojom-lite.js", html_source->AddResourcePath("app-management/image_info.mojom-lite.js",
IDR_APP_MANAGEMENT_IMAGE_INFO_MOJO_LITE_JS); IDR_APP_MANAGEMENT_IMAGE_INFO_MOJO_LITE_JS);
// TODO(crbug/967888): Remove when all the needed keys have been added
// to os_localized_string_provider.
::settings::AddBrowserLocalizedStrings(html_source, profile,
web_ui->GetWebContents());
// AddOsLocalizedStrings must be added after AddBrowserLocalizedStrings // AddOsLocalizedStrings must be added after AddBrowserLocalizedStrings
// as repeated keys used by the OS strings should override the same keys // as repeated keys used by the OS strings should override the same keys
// that may be used in the Browser string provider. // that may be used in the Browser string provider.
......
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