Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide r.h" | 5 #include "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide r.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/number_formatting.h" | 10 #include "base/i18n/number_formatting.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 #include "components/google/core/browser/google_util.h" | 28 #include "components/google/core/browser/google_util.h" |
| 29 #include "components/password_manager/core/browser/password_manager_constants.h" | 29 #include "components/password_manager/core/browser/password_manager_constants.h" |
| 30 #include "components/safe_browsing_db/safe_browsing_prefs.h" | 30 #include "components/safe_browsing_db/safe_browsing_prefs.h" |
| 31 #include "components/strings/grit/components_strings.h" | 31 #include "components/strings/grit/components_strings.h" |
| 32 #include "content/public/browser/web_ui_data_source.h" | 32 #include "content/public/browser/web_ui_data_source.h" |
| 33 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
| 34 | 34 |
| 35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
| 36 #include "ash/common/ash_switches.h" | 36 #include "ash/common/ash_switches.h" |
| 37 #include "ash/common/system/chromeos/devicetype_utils.h" | 37 #include "ash/common/system/chromeos/devicetype_utils.h" |
| 38 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | |
| 39 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_fact ory.h" | |
| 40 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | |
| 38 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 41 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 39 #include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_pro vider.h" | 42 #include "chrome/browser/ui/webui/chromeos/network_element_localized_strings_pro vider.h" |
| 40 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 43 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
| 41 #include "chromeos/chromeos_switches.h" | 44 #include "chromeos/chromeos_switches.h" |
| 42 #include "components/user_manager/user.h" | 45 #include "components/user_manager/user.h" |
| 43 #include "components/user_manager/user_manager.h" | 46 #include "components/user_manager/user_manager.h" |
| 44 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" | 47 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" |
| 45 #else | 48 #else |
| 46 #include "chrome/browser/ui/webui/settings/system_handler.h" | 49 #include "chrome/browser/ui/webui/settings/system_handler.h" |
| 47 #endif | 50 #endif |
| (...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1001 #if defined(OS_CHROMEOS) | 1004 #if defined(OS_CHROMEOS) |
| 1002 // Only the Chrome OS help article explains how language order affects website | 1005 // Only the Chrome OS help article explains how language order affects website |
| 1003 // language. | 1006 // language. |
| 1004 html_source->AddString( | 1007 html_source->AddString( |
| 1005 "languagesLearnMoreURL", | 1008 "languagesLearnMoreURL", |
| 1006 base::ASCIIToUTF16(chrome::kLanguageSettingsLearnMoreUrl)); | 1009 base::ASCIIToUTF16(chrome::kLanguageSettingsLearnMoreUrl)); |
| 1007 #endif | 1010 #endif |
| 1008 } | 1011 } |
| 1009 | 1012 |
| 1010 #if defined(OS_CHROMEOS) | 1013 #if defined(OS_CHROMEOS) |
| 1011 void AddMultiProfilesStrings(content::WebUIDataSource* html_source, | 1014 void AddChromeOSUserStrings(content::WebUIDataSource* html_source, |
| 1012 Profile* profile) { | 1015 Profile* profile) { |
| 1013 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 1016 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 1014 | 1017 |
| 1015 const user_manager::User* user = | 1018 const user_manager::User* user = |
| 1016 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 1019 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 1017 const user_manager::User* primary_user = user_manager->GetPrimaryUser(); | 1020 const user_manager::User* primary_user = user_manager->GetPrimaryUser(); |
| 1018 std::string primary_user_email = primary_user->GetAccountId().GetUserEmail(); | 1021 std::string primary_user_email = primary_user->GetAccountId().GetUserEmail(); |
| 1019 html_source->AddString("primaryUserEmail", primary_user_email); | 1022 html_source->AddString("primaryUserEmail", primary_user_email); |
| 1020 html_source->AddBoolean( | 1023 html_source->AddBoolean( |
| 1021 "isSecondaryUser", | 1024 "isSecondaryUser", |
| 1022 user && user->GetAccountId() != primary_user->GetAccountId()); | 1025 user && user->GetAccountId() != primary_user->GetAccountId()); |
| 1023 html_source->AddString( | 1026 html_source->AddString( |
| 1024 "secondaryUserBannerText", | 1027 "secondaryUserBannerText", |
| 1025 l10n_util::GetStringFUTF16(IDS_SETTINGS_SECONDARY_USER_BANNER, | 1028 l10n_util::GetStringFUTF16(IDS_SETTINGS_SECONDARY_USER_BANNER, |
| 1026 base::ASCIIToUTF16(primary_user_email))); | 1029 base::ASCIIToUTF16(primary_user_email))); |
| 1030 | |
| 1031 policy::BrowserPolicyConnectorChromeOS* connector = | |
| 1032 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | |
| 1033 if (!connector->IsEnterpriseManaged() && | |
| 1034 !user_manager->IsCurrentUserOwner()) { | |
| 1035 html_source->AddString("ownerEmail", | |
| 1036 user_manager->GetOwnerAccountId().GetUserEmail()); | |
| 1037 } | |
| 1027 } | 1038 } |
| 1028 #endif | 1039 #endif |
| 1029 | 1040 |
| 1030 void AddOnStartupStrings(content::WebUIDataSource* html_source) { | 1041 void AddOnStartupStrings(content::WebUIDataSource* html_source) { |
| 1031 LocalizedString localized_strings[] = { | 1042 LocalizedString localized_strings[] = { |
| 1032 {"onStartup", IDS_SETTINGS_ON_STARTUP}, | 1043 {"onStartup", IDS_SETTINGS_ON_STARTUP}, |
| 1033 {"onStartupOpenNewTab", IDS_SETTINGS_ON_STARTUP_OPEN_NEW_TAB}, | 1044 {"onStartupOpenNewTab", IDS_SETTINGS_ON_STARTUP_OPEN_NEW_TAB}, |
| 1034 {"onStartupContinue", IDS_SETTINGS_ON_STARTUP_CONTINUE}, | 1045 {"onStartupContinue", IDS_SETTINGS_ON_STARTUP_CONTINUE}, |
| 1035 {"onStartupOpenSpecific", IDS_SETTINGS_ON_STARTUP_OPEN_SPECIFIC}, | 1046 {"onStartupOpenSpecific", IDS_SETTINGS_ON_STARTUP_OPEN_SPECIFIC}, |
| 1036 {"onStartupUseCurrent", IDS_SETTINGS_ON_STARTUP_USE_CURRENT}, | 1047 {"onStartupUseCurrent", IDS_SETTINGS_ON_STARTUP_USE_CURRENT}, |
| (...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1946 AddWebContentStrings(html_source); | 1957 AddWebContentStrings(html_source); |
| 1947 | 1958 |
| 1948 #if defined(OS_CHROMEOS) | 1959 #if defined(OS_CHROMEOS) |
| 1949 AddAccountUITweaksStrings(html_source, profile); | 1960 AddAccountUITweaksStrings(html_source, profile); |
| 1950 AddAndroidAppStrings(html_source); | 1961 AddAndroidAppStrings(html_source); |
| 1951 AddBluetoothStrings(html_source); | 1962 AddBluetoothStrings(html_source); |
| 1952 AddDateTimeStrings(html_source); | 1963 AddDateTimeStrings(html_source); |
| 1953 AddDeviceStrings(html_source); | 1964 AddDeviceStrings(html_source); |
| 1954 AddEasyUnlockStrings(html_source); | 1965 AddEasyUnlockStrings(html_source); |
| 1955 AddInternetStrings(html_source); | 1966 AddInternetStrings(html_source); |
| 1956 AddMultiProfilesStrings(html_source, profile); | 1967 AddChromeOSUserStrings(html_source, profile); |
|
Dan Beam
2017/03/14 18:11:53
this was alphabetized
michaelpg
2017/03/14 23:09:04
ah, didn't realize that.
I saw that the function
| |
| 1957 AddOncStrings(html_source); | 1968 AddOncStrings(html_source); |
| 1958 #else | 1969 #else |
| 1959 AddDefaultBrowserStrings(html_source); | 1970 AddDefaultBrowserStrings(html_source); |
| 1960 AddImportDataStrings(html_source); | 1971 AddImportDataStrings(html_source); |
| 1961 AddSystemStrings(html_source); | 1972 AddSystemStrings(html_source); |
| 1962 #endif | 1973 #endif |
| 1963 | 1974 |
| 1964 #if defined(USE_NSS_CERTS) | 1975 #if defined(USE_NSS_CERTS) |
| 1965 AddCertificateManagerStrings(html_source); | 1976 AddCertificateManagerStrings(html_source); |
| 1966 #endif | 1977 #endif |
| 1967 | 1978 |
| 1968 #if defined(OS_CHROMEOS) | 1979 #if defined(OS_CHROMEOS) |
| 1969 chromeos::network_element::AddLocalizedStrings(html_source); | 1980 chromeos::network_element::AddLocalizedStrings(html_source); |
| 1970 #endif | 1981 #endif |
| 1971 policy_indicator::AddLocalizedStrings(html_source); | 1982 policy_indicator::AddLocalizedStrings(html_source); |
| 1972 | 1983 |
| 1973 html_source->SetJsonPath(kLocalizedStringsFile); | 1984 html_source->SetJsonPath(kLocalizedStringsFile); |
| 1974 } | 1985 } |
| 1975 | 1986 |
| 1976 } // namespace settings | 1987 } // namespace settings |
| OLD | NEW |