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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
11 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" | 14 #include "chrome/browser/ui/webui/policy_indicator_localized_strings_provider.h" |
14 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
15 #include "chrome/grit/chromium_strings.h" | 16 #include "chrome/grit/chromium_strings.h" |
16 #include "chrome/grit/generated_resources.h" | 17 #include "chrome/grit/generated_resources.h" |
17 #include "chrome/grit/google_chrome_strings.h" | 18 #include "chrome/grit/google_chrome_strings.h" |
18 #include "chrome/grit/locale_settings.h" | 19 #include "chrome/grit/locale_settings.h" |
19 #include "chrome/grit/settings_chromium_strings.h" | 20 #include "chrome/grit/settings_chromium_strings.h" |
20 #include "chrome/grit/settings_google_chrome_strings.h" | 21 #include "chrome/grit/settings_google_chrome_strings.h" |
21 #include "chrome/grit/settings_strings.h" | 22 #include "chrome/grit/settings_strings.h" |
22 #include "components/google/core/browser/google_util.h" | 23 #include "components/google/core/browser/google_util.h" |
23 #include "content/public/browser/web_ui_data_source.h" | 24 #include "content/public/browser/web_ui_data_source.h" |
24 #include "grit/components_strings.h" | 25 #include "grit/components_strings.h" |
25 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
26 | 27 |
27 #if defined(OS_CHROMEOS) | 28 #if defined(OS_CHROMEOS) |
28 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 29 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
29 #include "chrome/browser/signin/easy_unlock_service.h" | 30 #include "chrome/browser/signin/easy_unlock_service.h" |
30 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 31 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
| 32 #include "chromeos/chromeos_switches.h" |
31 #include "components/user_manager/user.h" | 33 #include "components/user_manager/user.h" |
32 #include "components/user_manager/user_manager.h" | 34 #include "components/user_manager/user_manager.h" |
33 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" | 35 #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" |
34 #endif | 36 #endif |
35 | 37 |
36 namespace { | 38 namespace { |
37 | 39 |
38 // Note that settings.html contains a <script> tag which imports a script of | 40 // Note that settings.html contains a <script> tag which imports a script of |
39 // the following name. These names must be kept in sync. | 41 // the following name. These names must be kept in sync. |
40 const char kLocalizedStringsFile[] = "strings.js"; | 42 const char kLocalizedStringsFile[] = "strings.js"; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 {"clickOnStopLabel", IDS_SETTINGS_CLICK_ON_STOP_LABEL}, | 86 {"clickOnStopLabel", IDS_SETTINGS_CLICK_ON_STOP_LABEL}, |
85 {"delayBeforeClickLabel", IDS_SETTINGS_DELAY_BEFORE_CLICK_LABEL}, | 87 {"delayBeforeClickLabel", IDS_SETTINGS_DELAY_BEFORE_CLICK_LABEL}, |
86 {"delayBeforeClickExtremelyShort", | 88 {"delayBeforeClickExtremelyShort", |
87 IDS_SETTINGS_DELAY_BEFORE_CLICK_EXTREMELY_SHORT}, | 89 IDS_SETTINGS_DELAY_BEFORE_CLICK_EXTREMELY_SHORT}, |
88 {"delayBeforeClickVeryShort", IDS_SETTINGS_DELAY_BEFORE_CLICK_VERY_SHORT}, | 90 {"delayBeforeClickVeryShort", IDS_SETTINGS_DELAY_BEFORE_CLICK_VERY_SHORT}, |
89 {"delayBeforeClickShort", IDS_SETTINGS_DELAY_BEFORE_CLICK_SHORT}, | 91 {"delayBeforeClickShort", IDS_SETTINGS_DELAY_BEFORE_CLICK_SHORT}, |
90 {"delayBeforeClickLong", IDS_SETTINGS_DELAY_BEFORE_CLICK_LONG}, | 92 {"delayBeforeClickLong", IDS_SETTINGS_DELAY_BEFORE_CLICK_LONG}, |
91 {"delayBeforeClickVeryLong", IDS_SETTINGS_DELAY_BEFORE_CLICK_VERY_LONG}, | 93 {"delayBeforeClickVeryLong", IDS_SETTINGS_DELAY_BEFORE_CLICK_VERY_LONG}, |
92 {"onScreenKeyboardLabel", IDS_SETTINGS_ON_SCREEN_KEYBOARD_LABEL}, | 94 {"onScreenKeyboardLabel", IDS_SETTINGS_ON_SCREEN_KEYBOARD_LABEL}, |
93 {"a11yExplanation", IDS_SETTINGS_ACCESSIBILITY_EXPLANATION}, | 95 {"a11yExplanation", IDS_SETTINGS_ACCESSIBILITY_EXPLANATION}, |
| 96 {"caretHighlightLabel", |
| 97 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_CARET_HIGHLIGHT_DESCRIPTION}, |
| 98 {"cursorHighlightLabel", |
| 99 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_CURSOR_HIGHLIGHT_DESCRIPTION}, |
| 100 {"focusHighlightLabel", |
| 101 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_FOCUS_HIGHLIGHT_DESCRIPTION}, |
| 102 {"selectToSpeakLabel", |
| 103 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SELECT_TO_SPEAK_DESCRIPTION}, |
| 104 {"switchAccessLabel", |
| 105 IDS_OPTIONS_SETTINGS_ACCESSIBILITY_SWITCH_ACCESS_DESCRIPTION}, |
94 #endif | 106 #endif |
95 }; | 107 }; |
96 AddLocalizedStringsBulk(html_source, localized_strings, | 108 AddLocalizedStringsBulk(html_source, localized_strings, |
97 arraysize(localized_strings)); | 109 arraysize(localized_strings)); |
98 | 110 |
99 #if defined(OS_CHROMEOS) | 111 #if defined(OS_CHROMEOS) |
100 html_source->AddString("a11yLearnMoreUrl", | 112 html_source->AddString("a11yLearnMoreUrl", |
101 chrome::kChromeAccessibilityHelpURL); | 113 chrome::kChromeAccessibilityHelpURL); |
| 114 |
| 115 html_source->AddBoolean("showExperimentalA11yFeatures", |
| 116 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 117 chromeos::switches::kEnableExperimentalAccessibilityFeatures)); |
102 #endif | 118 #endif |
103 } | 119 } |
104 | 120 |
105 void AddAboutStrings(content::WebUIDataSource* html_source) { | 121 void AddAboutStrings(content::WebUIDataSource* html_source) { |
106 LocalizedString localized_strings[] = { | 122 LocalizedString localized_strings[] = { |
107 {"aboutProgram", IDS_SETTINGS_ABOUT_PROGRAM}, | 123 {"aboutProgram", IDS_SETTINGS_ABOUT_PROGRAM}, |
108 }; | 124 }; |
109 AddLocalizedStringsBulk(html_source, localized_strings, | 125 AddLocalizedStringsBulk(html_source, localized_strings, |
110 arraysize(localized_strings)); | 126 arraysize(localized_strings)); |
111 } | 127 } |
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 #endif | 871 #endif |
856 AddUsersStrings(html_source); | 872 AddUsersStrings(html_source); |
857 AddWebContentStrings(html_source); | 873 AddWebContentStrings(html_source); |
858 | 874 |
859 policy_indicator::AddLocalizedStrings(html_source); | 875 policy_indicator::AddLocalizedStrings(html_source); |
860 | 876 |
861 html_source->SetJsonPath(kLocalizedStringsFile); | 877 html_source->SetJsonPath(kLocalizedStringsFile); |
862 } | 878 } |
863 | 879 |
864 } // namespace settings | 880 } // namespace settings |
OLD | NEW |