| 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/common/keyboard/keyboard_ui.h" | 9 #include "ash/common/keyboard/keyboard_ui.h" |
| 10 #include "ash/common/system/tray/system_tray_notifier.h" | 10 #include "ash/common/system/tray/system_tray_notifier.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 bool IsSmartVirtualKeyboardEnabled() { | 31 bool IsSmartVirtualKeyboardEnabled() { |
| 32 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 32 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 33 keyboard::switches::kEnableVirtualKeyboard)) { | 33 keyboard::switches::kEnableVirtualKeyboard)) { |
| 34 return false; | 34 return false; |
| 35 } | 35 } |
| 36 return keyboard::IsSmartDeployEnabled(); | 36 return keyboard::IsSmartDeployEnabled(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void MoveKeyboardToDisplayInternal(const int64_t display_id) { | 39 void MoveKeyboardToDisplayInternal(const int64_t display_id) { |
| 40 // Remove the keyboard from curent root window controller | 40 // Remove the keyboard from curent root window controller |
| 41 WmShell::Get()->keyboard_ui()->Hide(); | 41 Shell::Get()->keyboard_ui()->Hide(); |
| 42 RootWindowController::ForWindow( | 42 RootWindowController::ForWindow( |
| 43 keyboard::KeyboardController::GetInstance()->GetContainerWindow()) | 43 keyboard::KeyboardController::GetInstance()->GetContainerWindow()) |
| 44 ->DeactivateKeyboard(keyboard::KeyboardController::GetInstance()); | 44 ->DeactivateKeyboard(keyboard::KeyboardController::GetInstance()); |
| 45 | 45 |
| 46 for (RootWindowController* controller : | 46 for (RootWindowController* controller : |
| 47 Shell::GetInstance()->GetAllRootWindowControllers()) { | 47 Shell::GetInstance()->GetAllRootWindowControllers()) { |
| 48 if (display::Screen::GetScreen() | 48 if (display::Screen::GetScreen() |
| 49 ->GetDisplayNearestWindow(controller->GetRootWindow()) | 49 ->GetDisplayNearestWindow(controller->GetRootWindow()) |
| 50 .id() == display_id) { | 50 .id() == display_id) { |
| 51 controller->ActivateKeyboard(keyboard::KeyboardController::GetInstance()); | 51 controller->ActivateKeyboard(keyboard::KeyboardController::GetInstance()); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 if (is_enabled == was_enabled) | 212 if (is_enabled == was_enabled) |
| 213 return; | 213 return; |
| 214 if (is_enabled) { | 214 if (is_enabled) { |
| 215 Shell::GetInstance()->CreateKeyboard(); | 215 Shell::GetInstance()->CreateKeyboard(); |
| 216 } else { | 216 } else { |
| 217 Shell::GetInstance()->DeactivateKeyboard(); | 217 Shell::GetInstance()->DeactivateKeyboard(); |
| 218 } | 218 } |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace ash | 221 } // namespace ash |
| OLD | NEW |