OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/options/chromeos/keyboard_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/keyboard_handler.h" |
6 | 6 |
7 #include "base/command_line.h" | |
7 #include "base/values.h" | 8 #include "base/values.h" |
8 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 9 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
10 #include "chrome/common/chrome_switches.h" | |
11 #include "content/public/browser/web_ui.h" | |
9 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
10 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
11 | 14 |
12 namespace { | 15 namespace { |
13 const struct ModifierKeysSelectItem { | 16 const struct ModifierKeysSelectItem { |
14 int message_id; | 17 int message_id; |
15 chromeos::input_method::ModifierKey value; | 18 chromeos::input_method::ModifierKey value; |
16 } kModifierKeysSelectItems[] = { | 19 } kModifierKeysSelectItems[] = { |
17 { IDS_OPTIONS_SETTINGS_LANGUAGES_KEY_SEARCH, | 20 { IDS_OPTIONS_SETTINGS_LANGUAGES_KEY_SEARCH, |
18 chromeos::input_method::kSearchKey }, | 21 chromeos::input_method::kSearchKey }, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 ListValue* option = new ListValue(); | 79 ListValue* option = new ListValue(); |
77 option->Append(Value::CreateIntegerValue(value)); | 80 option->Append(Value::CreateIntegerValue(value)); |
78 option->Append(Value::CreateStringValue(l10n_util::GetStringUTF16( | 81 option->Append(Value::CreateStringValue(l10n_util::GetStringUTF16( |
79 message_id))); | 82 message_id))); |
80 list_value->Append(option); | 83 list_value->Append(option); |
81 } | 84 } |
82 localized_strings->Set(kDataValuesNames[i], list_value); | 85 localized_strings->Set(kDataValuesNames[i], list_value); |
83 } | 86 } |
84 } | 87 } |
85 | 88 |
89 void KeyboardHandler::InitializePage() { | |
90 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
91 switches::kHasChromeOSKeyboard)) { | |
Daniel Erat
2012/10/30 18:23:17
nit: don't think you need curly braces here (at le
Yusuke Sato
2012/10/30 19:27:23
Done.
| |
92 return; | |
93 } | |
94 const base::FundamentalValue show_options(true); | |
95 web_ui()->CallJavascriptFunction( | |
96 "options.KeyboardOverlay.showCapsLockOptions", show_options); | |
97 } | |
98 | |
86 } // namespace options | 99 } // namespace options |
87 } // namespace chromeos | 100 } // namespace chromeos |
OLD | NEW |