| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 bool IsGestureTypingEnabled() { | 203 bool IsGestureTypingEnabled() { |
| 204 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 204 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 205 switches::kDisableGestureTyping); | 205 switches::kDisableGestureTyping); |
| 206 } | 206 } |
| 207 | 207 |
| 208 bool IsGestureEditingEnabled() { | 208 bool IsGestureEditingEnabled() { |
| 209 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 209 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 210 switches::kDisableGestureEditing); | 210 switches::kDisableGestureEditing); |
| 211 } | 211 } |
| 212 | 212 |
| 213 bool IsSmartDeployEnabled() { | |
| 214 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 215 switches::kDisableSmartVirtualKeyboard); | |
| 216 } | |
| 217 | |
| 218 bool IsVoiceInputEnabled() { | 213 bool IsVoiceInputEnabled() { |
| 219 return !g_keyboard_restricted && | 214 return !g_keyboard_restricted && |
| 220 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 215 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 221 switches::kDisableVoiceInput); | 216 switches::kDisableVoiceInput); |
| 222 } | 217 } |
| 223 | 218 |
| 224 bool InsertText(const base::string16& text) { | 219 bool InsertText(const base::string16& text) { |
| 225 KeyboardController* controller = KeyboardController::GetInstance(); | 220 KeyboardController* controller = KeyboardController::GetInstance(); |
| 226 if (!controller) | 221 if (!controller) |
| 227 return false; | 222 return false; |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 387 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
| 393 UMA_HISTOGRAM_ENUMERATION("VirtualKeyboard.KeyboardControlEvent", event, | 388 UMA_HISTOGRAM_ENUMERATION("VirtualKeyboard.KeyboardControlEvent", event, |
| 394 KEYBOARD_CONTROL_MAX); | 389 KEYBOARD_CONTROL_MAX); |
| 395 } | 390 } |
| 396 | 391 |
| 397 void SetOverscrollEnabledWithAccessibilityKeyboard(bool enabled) { | 392 void SetOverscrollEnabledWithAccessibilityKeyboard(bool enabled) { |
| 398 g_overscroll_enabled_with_accessibility_keyboard = enabled; | 393 g_overscroll_enabled_with_accessibility_keyboard = enabled; |
| 399 } | 394 } |
| 400 | 395 |
| 401 } // namespace keyboard | 396 } // namespace keyboard |
| OLD | NEW |