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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 if (!IsKeyboardEnabled()) | 111 if (!IsKeyboardEnabled()) |
112 return false; | 112 return false; |
113 // Users of the accessibility on-screen keyboard are likely to be using mouse | 113 // Users of the accessibility on-screen keyboard are likely to be using mouse |
114 // input, which may interfere with overscrolling. | 114 // input, which may interfere with overscrolling. |
115 if (g_accessibility_keyboard_enabled) | 115 if (g_accessibility_keyboard_enabled) |
116 return false; | 116 return false; |
117 if (CommandLine::ForCurrentProcess()->HasSwitch( | 117 if (CommandLine::ForCurrentProcess()->HasSwitch( |
118 switches::kDisableVirtualKeyboardOverscroll)) { | 118 switches::kDisableVirtualKeyboardOverscroll)) { |
119 return false; | 119 return false; |
120 } | 120 } |
121 if (CommandLine::ForCurrentProcess()->HasSwitch( | 121 return true; |
122 switches::kEnableVirtualKeyboardOverscroll)) { | |
123 return true; | |
124 } | |
125 return false; | |
126 } | 122 } |
127 | 123 |
128 bool IsInputViewEnabled() { | 124 bool IsInputViewEnabled() { |
129 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) | 125 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) |
130 return true; | 126 return true; |
131 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInputView)) | 127 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableInputView)) |
132 return false; | 128 return false; |
133 // Default value if no command line flags specified. | 129 // Default value if no command line flags specified. |
134 return true; | 130 return true; |
135 } | 131 } |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 } | 339 } |
344 | 340 |
345 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 341 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
346 UMA_HISTOGRAM_ENUMERATION( | 342 UMA_HISTOGRAM_ENUMERATION( |
347 "VirtualKeyboard.KeyboardControlEvent", | 343 "VirtualKeyboard.KeyboardControlEvent", |
348 event, | 344 event, |
349 keyboard::KEYBOARD_CONTROL_MAX); | 345 keyboard::KEYBOARD_CONTROL_MAX); |
350 } | 346 } |
351 | 347 |
352 } // namespace keyboard | 348 } // namespace keyboard |
OLD | NEW |