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/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 | 177 |
178 bool IsFloatingVirtualKeyboardEnabled() { | 178 bool IsFloatingVirtualKeyboardEnabled() { |
179 std::string floating_virtual_keyboard_switch = | 179 std::string floating_virtual_keyboard_switch = |
180 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 180 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
181 switches::kFloatingVirtualKeyboard); | 181 switches::kFloatingVirtualKeyboard); |
182 return floating_virtual_keyboard_switch == | 182 return floating_virtual_keyboard_switch == |
183 switches::kFloatingVirtualKeyboardEnabled; | 183 switches::kFloatingVirtualKeyboardEnabled; |
184 } | 184 } |
185 | 185 |
186 bool IsGestureTypingEnabled() { | 186 bool IsGestureTypingEnabled() { |
187 std::string keyboard_switch = | 187 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
188 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 188 switches::kGestureTyping)) { |
189 switches::kGestureTyping); | 189 return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
190 return keyboard_switch == switches::kGestureTypingEnabled; | 190 switches::kGestureTyping) == switches::kGestureTypingEnabled; |
bshe
2015/09/04 14:07:25
perhaps just do:
keyboard_switch != switches::kGes
SteveT
2015/09/04 17:50:13
Oh right, because GetSwitchValueASCII returns "" i
| |
191 } | |
192 // Default value if no command line flags specified. | |
193 return true; | |
191 } | 194 } |
192 | 195 |
193 bool IsGestureEditingEnabled() { | 196 bool IsGestureEditingEnabled() { |
194 std::string keyboard_switch = | 197 std::string keyboard_switch = |
195 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 198 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
196 switches::kGestureEditing); | 199 switches::kGestureEditing); |
197 return keyboard_switch == switches::kGestureEditingEnabled; | 200 return keyboard_switch == switches::kGestureEditingEnabled; |
198 } | 201 } |
199 | 202 |
200 bool IsSmartDeployEnabled() { | 203 bool IsSmartDeployEnabled() { |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
473 } | 476 } |
474 | 477 |
475 void LogKeyboardControlEvent(KeyboardControlEvent event) { | 478 void LogKeyboardControlEvent(KeyboardControlEvent event) { |
476 UMA_HISTOGRAM_ENUMERATION( | 479 UMA_HISTOGRAM_ENUMERATION( |
477 "VirtualKeyboard.KeyboardControlEvent", | 480 "VirtualKeyboard.KeyboardControlEvent", |
478 event, | 481 event, |
479 keyboard::KEYBOARD_CONTROL_MAX); | 482 keyboard::KEYBOARD_CONTROL_MAX); |
480 } | 483 } |
481 | 484 |
482 } // namespace keyboard | 485 } // namespace keyboard |
OLD | NEW |