| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 switches::kEnableVirtualKeyboard) || | 109 switches::kEnableVirtualKeyboard) || |
| 110 IsKeyboardUsabilityExperimentEnabled() || | 110 IsKeyboardUsabilityExperimentEnabled() || |
| 111 g_touch_keyboard_enabled; | 111 g_touch_keyboard_enabled; |
| 112 } | 112 } |
| 113 | 113 |
| 114 bool IsKeyboardUsabilityExperimentEnabled() { | 114 bool IsKeyboardUsabilityExperimentEnabled() { |
| 115 return CommandLine::ForCurrentProcess()->HasSwitch( | 115 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 116 switches::kKeyboardUsabilityExperiment); | 116 switches::kKeyboardUsabilityExperiment); |
| 117 } | 117 } |
| 118 | 118 |
| 119 bool IsKeyboardOverscrollEnabled() { |
| 120 if (!IsKeyboardEnabled()) |
| 121 return false; |
| 122 // Users of the accessibility on-screen keyboard are likely to be using mouse |
| 123 // input, which may interfere with overscrolling. |
| 124 if (g_accessibility_keyboard_enabled) |
| 125 return false; |
| 126 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 127 switches::kDisableVirtualKeyboardOverscroll)) { |
| 128 return false; |
| 129 } |
| 130 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 131 switches::kEnableVirtualKeyboardOverscroll)) { |
| 132 return true; |
| 133 } |
| 134 return false; |
| 135 } |
| 136 |
| 119 bool IsInputViewEnabled() { | 137 bool IsInputViewEnabled() { |
| 120 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) | 138 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) |
| 121 return true; | 139 return true; |
| 122 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInputView)) | 140 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInputView)) |
| 123 return false; | 141 return false; |
| 124 // Default value if no command line flags specified. | 142 // Default value if no command line flags specified. |
| 125 return true; | 143 return true; |
| 126 } | 144 } |
| 127 | 145 |
| 128 bool InsertText(const base::string16& text, aura::Window* root_window) { | 146 bool InsertText(const base::string16& text, aura::Window* root_window) { |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 } | 352 } |
| 335 | 353 |
| 336 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 354 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
| 337 UMA_HISTOGRAM_ENUMERATION( | 355 UMA_HISTOGRAM_ENUMERATION( |
| 338 "VirtualKeyboard.KeyboardControlEvent", | 356 "VirtualKeyboard.KeyboardControlEvent", |
| 339 event, | 357 event, |
| 340 keyboard::KEYBOARD_CONTROL_MAX); | 358 keyboard::KEYBOARD_CONTROL_MAX); |
| 341 } | 359 } |
| 342 | 360 |
| 343 } // namespace keyboard | 361 } // namespace keyboard |
| OLD | NEW |