| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |