| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shell.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 if (in_mus_) | 433 if (in_mus_) |
| 434 return; | 434 return; |
| 435 // TODO(bshe): Primary root window controller may not be the controller to | 435 // TODO(bshe): Primary root window controller may not be the controller to |
| 436 // attach virtual keyboard. See http://crbug.com/303429 | 436 // attach virtual keyboard. See http://crbug.com/303429 |
| 437 InitKeyboard(); | 437 InitKeyboard(); |
| 438 GetPrimaryRootWindowController()->ActivateKeyboard( | 438 GetPrimaryRootWindowController()->ActivateKeyboard( |
| 439 keyboard::KeyboardController::GetInstance()); | 439 keyboard::KeyboardController::GetInstance()); |
| 440 } | 440 } |
| 441 | 441 |
| 442 void Shell::DeactivateKeyboard() { | 442 void Shell::DeactivateKeyboard() { |
| 443 keyboard_ui_->Hide(); | 443 // TODO(jamescook): Move keyboard create and hide into WmShell. |
| 444 wm_shell_->keyboard_ui()->Hide(); |
| 444 if (in_mus_) | 445 if (in_mus_) |
| 445 return; | 446 return; |
| 446 if (keyboard::KeyboardController::GetInstance()) { | 447 if (keyboard::KeyboardController::GetInstance()) { |
| 447 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 448 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| 448 for (RootWindowControllerList::iterator iter = controllers.begin(); | 449 for (RootWindowControllerList::iterator iter = controllers.begin(); |
| 449 iter != controllers.end(); ++iter) { | 450 iter != controllers.end(); ++iter) { |
| 450 (*iter)->DeactivateKeyboard(keyboard::KeyboardController::GetInstance()); | 451 (*iter)->DeactivateKeyboard(keyboard::KeyboardController::GetInstance()); |
| 451 } | 452 } |
| 452 } | 453 } |
| 453 keyboard::KeyboardController::ResetInstance(nullptr); | 454 keyboard::KeyboardController::ResetInstance(nullptr); |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 base::Unretained(system_tray_delegate)))); | 1063 base::Unretained(system_tray_delegate)))); |
| 1063 | 1064 |
| 1064 // Create TouchTransformerController before | 1065 // Create TouchTransformerController before |
| 1065 // WindowTreeHostManager::InitDisplays() | 1066 // WindowTreeHostManager::InitDisplays() |
| 1066 // since TouchTransformerController listens on | 1067 // since TouchTransformerController listens on |
| 1067 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). | 1068 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). |
| 1068 if (!in_mus_) | 1069 if (!in_mus_) |
| 1069 touch_transformer_controller_.reset(new TouchTransformerController()); | 1070 touch_transformer_controller_.reset(new TouchTransformerController()); |
| 1070 #endif // defined(OS_CHROMEOS) | 1071 #endif // defined(OS_CHROMEOS) |
| 1071 | 1072 |
| 1072 keyboard_ui_ = init_params.keyboard_factory.is_null() | 1073 wm_shell_->SetKeyboardUI(init_params.keyboard_factory.is_null() |
| 1073 ? KeyboardUI::Create() | 1074 ? KeyboardUI::Create() |
| 1074 : init_params.keyboard_factory.Run(); | 1075 : init_params.keyboard_factory.Run()); |
| 1075 | 1076 |
| 1076 window_tree_host_manager_->InitHosts(); | 1077 window_tree_host_manager_->InitHosts(); |
| 1077 | 1078 |
| 1078 #if defined(OS_CHROMEOS) | 1079 #if defined(OS_CHROMEOS) |
| 1079 // Needs to be created after InitDisplays() since it may cause the virtual | 1080 // Needs to be created after InitDisplays() since it may cause the virtual |
| 1080 // keyboard to be deployed. | 1081 // keyboard to be deployed. |
| 1081 virtual_keyboard_controller_.reset(new VirtualKeyboardController); | 1082 virtual_keyboard_controller_.reset(new VirtualKeyboardController); |
| 1082 #endif // defined(OS_CHROMEOS) | 1083 #endif // defined(OS_CHROMEOS) |
| 1083 | 1084 |
| 1084 #if defined(OS_CHROMEOS) | 1085 #if defined(OS_CHROMEOS) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 | 1201 |
| 1201 void Shell::OnWindowActivated( | 1202 void Shell::OnWindowActivated( |
| 1202 aura::client::ActivationChangeObserver::ActivationReason reason, | 1203 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1203 aura::Window* gained_active, | 1204 aura::Window* gained_active, |
| 1204 aura::Window* lost_active) { | 1205 aura::Window* lost_active) { |
| 1205 if (gained_active) | 1206 if (gained_active) |
| 1206 target_root_window_ = gained_active->GetRootWindow(); | 1207 target_root_window_ = gained_active->GetRootWindow(); |
| 1207 } | 1208 } |
| 1208 | 1209 |
| 1209 } // namespace ash | 1210 } // namespace ash |
| OLD | NEW |