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 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1793 {"supervisedUsersLabel", IDS_SETTINGS_USERS_SUPERVISED_USERS_LABEL}, | 1796 {"supervisedUsersLabel", IDS_SETTINGS_USERS_SUPERVISED_USERS_LABEL}, |
| 1794 {"showOnSigninLabel", IDS_SETTINGS_USERS_SHOW_ON_SIGNIN_LABEL}, | 1797 {"showOnSigninLabel", IDS_SETTINGS_USERS_SHOW_ON_SIGNIN_LABEL}, |
| 1795 {"restrictSigninLabel", IDS_SETTINGS_USERS_RESTRICT_SIGNIN_LABEL}, | 1798 {"restrictSigninLabel", IDS_SETTINGS_USERS_RESTRICT_SIGNIN_LABEL}, |
| 1796 {"deviceOwnerLabel", IDS_SETTINGS_USERS_DEVICE_OWNER_LABEL}, | 1799 {"deviceOwnerLabel", IDS_SETTINGS_USERS_DEVICE_OWNER_LABEL}, |
| 1797 {"addUsers", IDS_SETTINGS_USERS_ADD_USERS}, | 1800 {"addUsers", IDS_SETTINGS_USERS_ADD_USERS}, |
| 1798 {"addUsersEmail", IDS_SETTINGS_USERS_ADD_USERS_EMAIL}, | 1801 {"addUsersEmail", IDS_SETTINGS_USERS_ADD_USERS_EMAIL}, |
| 1799 #endif | 1802 #endif |
| 1800 }; | 1803 }; |
| 1801 AddLocalizedStringsBulk(html_source, localized_strings, | 1804 AddLocalizedStringsBulk(html_source, localized_strings, |
| 1802 arraysize(localized_strings)); | 1805 arraysize(localized_strings)); |
| 1806 | |
| 1807 #if defined(OS_CHROMEOS) | |
| 1808 policy::BrowserPolicyConnectorChromeOS* connector = | |
| 1809 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | |
| 1810 if (!connector->IsEnterpriseManaged() && | |
| 1811 !user_manager::UserManager::Get()->IsCurrentUserOwner()) { | |
| 1812 html_source->AddString( | |
| 1813 "ownerEmail", | |
| 1814 user_manager::UserManager::Get()->GetOwnerAccountId().GetUserEmail()); | |
| 1815 } | |
| 1816 #endif | |
|
stevenjb
2017/03/11 00:17:00
nit: maybe move this to AddMultiProfilesStrings (a
michaelpg
2017/03/13 23:34:43
Done (AddChromeOSUserStrings)
| |
| 1803 } | 1817 } |
| 1804 | 1818 |
| 1805 #if !defined(OS_CHROMEOS) | 1819 #if !defined(OS_CHROMEOS) |
| 1806 void AddSystemStrings(content::WebUIDataSource* html_source) { | 1820 void AddSystemStrings(content::WebUIDataSource* html_source) { |
| 1807 LocalizedString localized_strings[] = { | 1821 LocalizedString localized_strings[] = { |
| 1808 {"systemPageTitle", IDS_SETTINGS_SYSTEM}, | 1822 {"systemPageTitle", IDS_SETTINGS_SYSTEM}, |
| 1809 #if !defined(OS_MACOSX) | 1823 #if !defined(OS_MACOSX) |
| 1810 {"backgroundAppsLabel", IDS_SETTINGS_SYSTEM_BACKGROUND_APPS_LABEL}, | 1824 {"backgroundAppsLabel", IDS_SETTINGS_SYSTEM_BACKGROUND_APPS_LABEL}, |
| 1811 #endif | 1825 #endif |
| 1812 {"hardwareAccelerationLabel", | 1826 {"hardwareAccelerationLabel", |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1965 | 1979 |
| 1966 #if defined(OS_CHROMEOS) | 1980 #if defined(OS_CHROMEOS) |
| 1967 chromeos::network_element::AddLocalizedStrings(html_source); | 1981 chromeos::network_element::AddLocalizedStrings(html_source); |
| 1968 #endif | 1982 #endif |
| 1969 policy_indicator::AddLocalizedStrings(html_source); | 1983 policy_indicator::AddLocalizedStrings(html_source); |
| 1970 | 1984 |
| 1971 html_source->SetJsonPath(kLocalizedStringsFile); | 1985 html_source->SetJsonPath(kLocalizedStringsFile); |
| 1972 } | 1986 } |
| 1973 | 1987 |
| 1974 } // namespace settings | 1988 } // namespace settings |
| OLD | NEW |