Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: ash/virtual_keyboard_controller.cc

Issue 1149383006: Move smart deploy to tristate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change histogram id. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/virtual_keyboard_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ash/virtual_keyboard_controller.h" 5 #include "ash/virtual_keyboard_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/maximize_mode/maximize_mode_controller.h" 10 #include "ash/wm/maximize_mode/maximize_mode_controller.h"
(...skipping 10 matching lines...) Expand all
21 21
22 namespace ash { 22 namespace ash {
23 namespace { 23 namespace {
24 24
25 // Checks whether smart deployment is enabled. 25 // Checks whether smart deployment is enabled.
26 bool IsSmartVirtualKeyboardEnabled() { 26 bool IsSmartVirtualKeyboardEnabled() {
27 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 27 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
28 keyboard::switches::kEnableVirtualKeyboard)) { 28 keyboard::switches::kEnableVirtualKeyboard)) {
29 return false; 29 return false;
30 } 30 }
31 return !base::CommandLine::ForCurrentProcess()->HasSwitch( 31 return keyboard::IsSmartDeployEnabled();
32 keyboard::switches::kDisableSmartVirtualKeyboard);
33 } 32 }
34 33
35 } // namespace 34 } // namespace
36 35
37 VirtualKeyboardController::VirtualKeyboardController() 36 VirtualKeyboardController::VirtualKeyboardController()
38 : has_external_keyboard_(false), 37 : has_external_keyboard_(false),
39 has_internal_keyboard_(false), 38 has_internal_keyboard_(false),
40 has_touchscreen_(false), 39 has_touchscreen_(false),
41 ignore_external_keyboard_(false) { 40 ignore_external_keyboard_(false) {
42 Shell::GetInstance()->AddShellObserver(this); 41 Shell::GetInstance()->AddShellObserver(this);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 keyboard::SetTouchKeyboardEnabled(enabled); 126 keyboard::SetTouchKeyboardEnabled(enabled);
128 if (enabled) { 127 if (enabled) {
129 Shell::GetInstance()->CreateKeyboard(); 128 Shell::GetInstance()->CreateKeyboard();
130 } else { 129 } else {
131 if (!keyboard::IsKeyboardEnabled()) 130 if (!keyboard::IsKeyboardEnabled())
132 Shell::GetInstance()->DeactivateKeyboard(); 131 Shell::GetInstance()->DeactivateKeyboard();
133 } 132 }
134 } 133 }
135 134
136 } // namespace ash 135 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/virtual_keyboard_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698