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