| 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 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 32 keyboard::switches::kEnableAutoVirtualKeyboard); | 32 keyboard::switches::kDisableSmartVirtualKeyboard); |
| 33 } | 33 } |
| 34 | 34 |
| 35 } // namespace | 35 } // namespace |
| 36 | 36 |
| 37 VirtualKeyboardController::VirtualKeyboardController() | 37 VirtualKeyboardController::VirtualKeyboardController() |
| 38 : has_external_keyboard_(false), | 38 : has_external_keyboard_(false), |
| 39 has_internal_keyboard_(false), | 39 has_internal_keyboard_(false), |
| 40 has_touchscreen_(false), | 40 has_touchscreen_(false), |
| 41 ignore_external_keyboard_(false) { | 41 ignore_external_keyboard_(false) { |
| 42 Shell::GetInstance()->AddShellObserver(this); | 42 Shell::GetInstance()->AddShellObserver(this); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 keyboard::SetTouchKeyboardEnabled(enabled); | 116 keyboard::SetTouchKeyboardEnabled(enabled); |
| 117 if (enabled) { | 117 if (enabled) { |
| 118 Shell::GetInstance()->CreateKeyboard(); | 118 Shell::GetInstance()->CreateKeyboard(); |
| 119 } else { | 119 } else { |
| 120 if (!keyboard::IsKeyboardEnabled()) | 120 if (!keyboard::IsKeyboardEnabled()) |
| 121 Shell::GetInstance()->DeactivateKeyboard(); | 121 Shell::GetInstance()->DeactivateKeyboard(); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace ash | 125 } // namespace ash |
| OLD | NEW |