| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 switches::kEnableInputView)) | 147 switches::kEnableInputView)) |
| 148 return true; | 148 return true; |
| 149 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 149 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 150 switches::kDisableInputView)) | 150 switches::kDisableInputView)) |
| 151 return false; | 151 return false; |
| 152 // Default value if no command line flags specified. | 152 // Default value if no command line flags specified. |
| 153 return true; | 153 return true; |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool IsExperimentalInputViewEnabled() { | 156 bool IsExperimentalInputViewEnabled() { |
| 157 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 157 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 158 switches::kEnableExperimentalInputViewFeatures)) { | 158 switches::kEnableExperimentalInputViewFeatures); |
| 159 return true; | 159 } |
| 160 } | 160 |
| 161 return false; | 161 bool IsGestureTypingEnabled() { |
| 162 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 163 switches::kEnableGestureTyping); |
| 162 } | 164 } |
| 163 | 165 |
| 164 bool InsertText(const base::string16& text) { | 166 bool InsertText(const base::string16& text) { |
| 165 keyboard::KeyboardController* controller = KeyboardController::GetInstance(); | 167 keyboard::KeyboardController* controller = KeyboardController::GetInstance(); |
| 166 if (!controller) | 168 if (!controller) |
| 167 return false; | 169 return false; |
| 168 | 170 |
| 169 ui::InputMethod* input_method = controller->proxy()->GetInputMethod(); | 171 ui::InputMethod* input_method = controller->proxy()->GetInputMethod(); |
| 170 if (!input_method) | 172 if (!input_method) |
| 171 return false; | 173 return false; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 } | 387 } |
| 386 | 388 |
| 387 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 389 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
| 388 UMA_HISTOGRAM_ENUMERATION( | 390 UMA_HISTOGRAM_ENUMERATION( |
| 389 "VirtualKeyboard.KeyboardControlEvent", | 391 "VirtualKeyboard.KeyboardControlEvent", |
| 390 event, | 392 event, |
| 391 keyboard::KEYBOARD_CONTROL_MAX); | 393 keyboard::KEYBOARD_CONTROL_MAX); |
| 392 } | 394 } |
| 393 | 395 |
| 394 } // namespace keyboard | 396 } // namespace keyboard |
| OLD | NEW |