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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 switches::kEnableVirtualKeyboard) || | 100 switches::kEnableVirtualKeyboard) || |
101 IsKeyboardUsabilityExperimentEnabled() || | 101 IsKeyboardUsabilityExperimentEnabled() || |
102 g_touch_keyboard_enabled; | 102 g_touch_keyboard_enabled; |
103 } | 103 } |
104 | 104 |
105 bool IsKeyboardUsabilityExperimentEnabled() { | 105 bool IsKeyboardUsabilityExperimentEnabled() { |
106 return CommandLine::ForCurrentProcess()->HasSwitch( | 106 return CommandLine::ForCurrentProcess()->HasSwitch( |
107 switches::kKeyboardUsabilityExperiment); | 107 switches::kKeyboardUsabilityExperiment); |
108 } | 108 } |
109 | 109 |
| 110 bool IsKeyboardOverscrollEnabled() { |
| 111 if (!IsKeyboardEnabled()) |
| 112 return false; |
| 113 // Users of the accessibility on-screen keyboard are likely to be using mouse |
| 114 // input, which may interfere with overscrolling. |
| 115 if (g_accessibility_keyboard_enabled) |
| 116 return false; |
| 117 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 118 switches::kDisableVirtualKeyboardOverscroll)) { |
| 119 return false; |
| 120 } |
| 121 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 122 switches::kEnableVirtualKeyboardOverscroll)) { |
| 123 return true; |
| 124 } |
| 125 return false; |
| 126 } |
| 127 |
110 bool IsInputViewEnabled() { | 128 bool IsInputViewEnabled() { |
111 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) | 129 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) |
112 return true; | 130 return true; |
113 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInputView)) | 131 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInputView)) |
114 return false; | 132 return false; |
115 // Default value if no command line flags specified. | 133 // Default value if no command line flags specified. |
116 return true; | 134 return true; |
117 } | 135 } |
118 | 136 |
119 bool InsertText(const base::string16& text, aura::Window* root_window) { | 137 bool InsertText(const base::string16& text, aura::Window* root_window) { |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } | 343 } |
326 | 344 |
327 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 345 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
328 UMA_HISTOGRAM_ENUMERATION( | 346 UMA_HISTOGRAM_ENUMERATION( |
329 "VirtualKeyboard.KeyboardControlEvent", | 347 "VirtualKeyboard.KeyboardControlEvent", |
330 event, | 348 event, |
331 keyboard::KEYBOARD_CONTROL_MAX); | 349 keyboard::KEYBOARD_CONTROL_MAX); |
332 } | 350 } |
333 | 351 |
334 } // namespace keyboard | 352 } // namespace keyboard |
OLD | NEW |