| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 ui::EF_NONE); | 29 ui::EF_NONE); |
| 30 root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&event); | 30 root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&event); |
| 31 } | 31 } |
| 32 | 32 |
| 33 } // namespace | 33 } // namespace |
| 34 | 34 |
| 35 namespace keyboard { | 35 namespace keyboard { |
| 36 | 36 |
| 37 bool IsKeyboardEnabled() { | 37 bool IsKeyboardEnabled() { |
| 38 return CommandLine::ForCurrentProcess()->HasSwitch( | 38 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 39 switches::kEnableVirtualKeyboard); | 39 switches::kEnableVirtualKeyboard) || |
| 40 CommandLine::ForCurrentProcess()->HasSwitch( |
| 41 switches::kKeyboardUsabilityTest); |
| 42 |
| 40 } | 43 } |
| 41 | 44 |
| 42 bool InsertText(const base::string16& text, aura::RootWindow* root_window) { | 45 bool InsertText(const base::string16& text, aura::RootWindow* root_window) { |
| 43 if (!root_window) | 46 if (!root_window) |
| 44 return false; | 47 return false; |
| 45 | 48 |
| 46 ui::InputMethod* input_method = root_window->GetProperty( | 49 ui::InputMethod* input_method = root_window->GetProperty( |
| 47 aura::client::kRootWindowInputMethodKey); | 50 aura::client::kRootWindowInputMethodKey); |
| 48 if (!input_method) | 51 if (!input_method) |
| 49 return false; | 52 return false; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 221 } |
| 219 | 222 |
| 220 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 223 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
| 221 UMA_HISTOGRAM_ENUMERATION( | 224 UMA_HISTOGRAM_ENUMERATION( |
| 222 "VirtualKeyboard.KeyboardControlEvent", | 225 "VirtualKeyboard.KeyboardControlEvent", |
| 223 event, | 226 event, |
| 224 keyboard::KEYBOARD_CONTROL_MAX); | 227 keyboard::KEYBOARD_CONTROL_MAX); |
| 225 } | 228 } |
| 226 | 229 |
| 227 } // namespace keyboard | 230 } // namespace keyboard |
| OLD | NEW |