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/command_line.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 9 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 message_id))); | 89 message_id))); |
90 list_value->Append(option); | 90 list_value->Append(option); |
91 } | 91 } |
92 localized_strings->Set(kDataValuesNames[i], list_value); | 92 localized_strings->Set(kDataValuesNames[i], list_value); |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 void KeyboardHandler::InitializePage() { | 96 void KeyboardHandler::InitializePage() { |
97 bool chromeos_keyboard = CommandLine::ForCurrentProcess()->HasSwitch( | 97 bool chromeos_keyboard = CommandLine::ForCurrentProcess()->HasSwitch( |
98 switches::kHasChromeOSKeyboard); | 98 switches::kHasChromeOSKeyboard); |
99 const base::FundamentalValue show_caps_lock_options(chromeos_keyboard); | 99 const base::FundamentalValue show_caps_lock_options(!chromeos_keyboard); |
100 | 100 |
101 bool has_diamond_key = CommandLine::ForCurrentProcess()->HasSwitch( | 101 bool has_diamond_key = CommandLine::ForCurrentProcess()->HasSwitch( |
102 switches::kHasChromeOSDiamondKey); | 102 switches::kHasChromeOSDiamondKey); |
103 const base::FundamentalValue show_diamond_key_options(has_diamond_key); | 103 const base::FundamentalValue show_diamond_key_options(has_diamond_key); |
104 | 104 |
105 web_ui()->CallJavascriptFunction( | 105 web_ui()->CallJavascriptFunction( |
106 "options.KeyboardOverlay.showCapsLockOptions", | 106 "options.KeyboardOverlay.showCapsLockOptions", |
107 show_caps_lock_options); | 107 show_caps_lock_options); |
108 web_ui()->CallJavascriptFunction( | 108 web_ui()->CallJavascriptFunction( |
109 "options.KeyboardOverlay.showDiamondKeyOptions", | 109 "options.KeyboardOverlay.showDiamondKeyOptions", |
110 show_diamond_key_options); | 110 show_diamond_key_options); |
111 } | 111 } |
112 | 112 |
113 } // namespace options | 113 } // namespace options |
114 } // namespace chromeos | 114 } // namespace chromeos |
OLD | NEW |