OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/keyboard/keyboard_util.h" | 5 #include "ui/keyboard/keyboard_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 namespace keyboard { | 40 namespace keyboard { |
41 | 41 |
42 bool IsKeyboardEnabled() { | 42 bool IsKeyboardEnabled() { |
43 return CommandLine::ForCurrentProcess()->HasSwitch( | 43 return CommandLine::ForCurrentProcess()->HasSwitch( |
44 switches::kEnableVirtualKeyboard) || | 44 switches::kEnableVirtualKeyboard) || |
45 CommandLine::ForCurrentProcess()->HasSwitch( | 45 CommandLine::ForCurrentProcess()->HasSwitch( |
46 switches::kKeyboardUsabilityTest); | 46 switches::kKeyboardUsabilityTest); |
47 | 47 |
48 } | 48 } |
49 | 49 |
| 50 bool IsKeyboardUsabilityTestEnabled() { |
| 51 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 52 switches::kKeyboardUsabilityTest); |
| 53 } |
| 54 |
50 bool InsertText(const base::string16& text, aura::Window* root_window) { | 55 bool InsertText(const base::string16& text, aura::Window* root_window) { |
51 if (!root_window) | 56 if (!root_window) |
52 return false; | 57 return false; |
53 | 58 |
54 ui::InputMethod* input_method = root_window->GetProperty( | 59 ui::InputMethod* input_method = root_window->GetProperty( |
55 aura::client::kRootWindowInputMethodKey); | 60 aura::client::kRootWindowInputMethodKey); |
56 if (!input_method) | 61 if (!input_method) |
57 return false; | 62 return false; |
58 | 63 |
59 ui::TextInputClient* tic = input_method->GetTextInputClient(); | 64 ui::TextInputClient* tic = input_method->GetTextInputClient(); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 } | 249 } |
245 | 250 |
246 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 251 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
247 UMA_HISTOGRAM_ENUMERATION( | 252 UMA_HISTOGRAM_ENUMERATION( |
248 "VirtualKeyboard.KeyboardControlEvent", | 253 "VirtualKeyboard.KeyboardControlEvent", |
249 event, | 254 event, |
250 keyboard::KEYBOARD_CONTROL_MAX); | 255 keyboard::KEYBOARD_CONTROL_MAX); |
251 } | 256 } |
252 | 257 |
253 } // namespace keyboard | 258 } // namespace keyboard |
OLD | NEW |