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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" |
9 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
10 #include "chrome/grit/chromium_strings.h" | 11 #include "chrome/grit/chromium_strings.h" |
11 #include "chrome/grit/generated_resources.h" | 12 #include "chrome/grit/generated_resources.h" |
12 #include "chrome/grit/google_chrome_strings.h" | 13 #include "chrome/grit/google_chrome_strings.h" |
13 #include "chrome/grit/locale_settings.h" | 14 #include "chrome/grit/locale_settings.h" |
14 #include "chrome/grit/settings_strings.h" | 15 #include "chrome/grit/settings_strings.h" |
15 #include "content/public/browser/web_ui_data_source.h" | 16 #include "content/public/browser/web_ui_data_source.h" |
16 #include "grit/components_strings.h" | 17 #include "grit/components_strings.h" |
17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
18 | 19 |
19 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
20 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 21 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
21 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 22 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
22 #include "components/user_manager/user.h" | 23 #include "components/user_manager/user.h" |
23 #include "components/user_manager/user_manager.h" | 24 #include "components/user_manager/user_manager.h" |
24 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" | 25 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" |
25 #endif | 26 #endif |
26 | 27 |
27 namespace { | 28 namespace { |
28 | 29 |
29 // Note that settings.html contains a <script> tag which imports a script of | 30 // Note that settings.html contains a <script> tag which imports a script of |
30 // the following name. These names must be kept in sync. | 31 // the following name. These names must be kept in sync. |
31 const char kLocalizedStringsFile[] = "strings.js"; | 32 const char kLocalizedStringsFile[] = "strings.js"; |
32 | 33 |
33 void AddCommonStrings(content::WebUIDataSource* html_source) { | 34 void AddCommonStrings(content::WebUIDataSource* html_source) { |
34 html_source->AddLocalizedString("basicPageTitle", IDS_SETTINGS_BASIC); | 35 html_source->AddLocalizedString("basicPageTitle", IDS_SETTINGS_BASIC); |
35 html_source->AddLocalizedString("advancedPageTitle", IDS_SETTINGS_ADVANCED); | 36 html_source->AddLocalizedString("advancedPageTitle", IDS_SETTINGS_ADVANCED); |
36 html_source->AddLocalizedString("addLabel", IDS_ADD); | 37 html_source->AddLocalizedString("addLabel", IDS_ADD); |
37 #if defined(OS_CHROMEOS) | |
38 html_source->AddLocalizedString("controlledSettingShared", | |
39 IDS_OPTIONS_CONTROLLED_SETTING_SHARED); | |
40 html_source->AddLocalizedString("controlledSettingOwner", | |
41 IDS_OPTIONS_CONTROLLED_SETTING_OWNER); | |
42 #endif | |
43 html_source->AddLocalizedString("controlledSettingPolicy", | |
44 IDS_OPTIONS_CONTROLLED_SETTING_POLICY); | |
45 html_source->AddLocalizedString("controlledSettingRecommendedMatches", | |
46 IDS_OPTIONS_CONTROLLED_SETTING_RECOMMENDED); | |
47 html_source->AddLocalizedString( | |
48 "controlledSettingRecommendedDiffers", | |
49 IDS_OPTIONS_CONTROLLED_SETTING_HAS_RECOMMENDATION); | |
50 html_source->AddLocalizedString("controlledSettingExtension", | |
51 IDS_SETTINGS_CONTROLLED_SETTING_EXTENSION); | |
52 html_source->AddLocalizedString("learnMore", IDS_LEARN_MORE); | 38 html_source->AddLocalizedString("learnMore", IDS_LEARN_MORE); |
53 } | 39 } |
54 | 40 |
55 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
56 void AddA11yStrings(content::WebUIDataSource* html_source) { | 42 void AddA11yStrings(content::WebUIDataSource* html_source) { |
57 html_source->AddLocalizedString( | 43 html_source->AddLocalizedString( |
58 "a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY); | 44 "a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY); |
59 html_source->AddLocalizedString( | 45 html_source->AddLocalizedString( |
60 "moreFeaturesLink", IDS_SETTINGS_MORE_FEATURES_LINK); | 46 "moreFeaturesLink", IDS_SETTINGS_MORE_FEATURES_LINK); |
61 html_source->AddLocalizedString( | 47 html_source->AddLocalizedString( |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 AddPrivacyStrings(html_source); | 545 AddPrivacyStrings(html_source); |
560 AddSearchEnginesStrings(html_source); | 546 AddSearchEnginesStrings(html_source); |
561 AddSearchStrings(html_source); | 547 AddSearchStrings(html_source); |
562 #if !defined(OS_CHROMEOS) | 548 #if !defined(OS_CHROMEOS) |
563 AddSigninSettingsStrings(html_source); | 549 AddSigninSettingsStrings(html_source); |
564 #endif | 550 #endif |
565 AddSiteSettingsStrings(html_source); | 551 AddSiteSettingsStrings(html_source); |
566 AddSyncStrings(html_source); | 552 AddSyncStrings(html_source); |
567 AddUsersStrings(html_source); | 553 AddUsersStrings(html_source); |
568 | 554 |
| 555 policy_indicator::AddLocalizedStrings(html_source); |
| 556 |
569 html_source->SetJsonPath(kLocalizedStringsFile); | 557 html_source->SetJsonPath(kLocalizedStringsFile); |
570 } | 558 } |
571 | 559 |
572 } // namespace settings | 560 } // namespace settings |
OLD | NEW |