| 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 if (in_mus_) | 431 if (in_mus_) |
| 432 return; | 432 return; |
| 433 // TODO(bshe): Primary root window controller may not be the controller to | 433 // TODO(bshe): Primary root window controller may not be the controller to |
| 434 // attach virtual keyboard. See http://crbug.com/303429 | 434 // attach virtual keyboard. See http://crbug.com/303429 |
| 435 InitKeyboard(); | 435 InitKeyboard(); |
| 436 GetPrimaryRootWindowController()->ActivateKeyboard( | 436 GetPrimaryRootWindowController()->ActivateKeyboard( |
| 437 keyboard::KeyboardController::GetInstance()); | 437 keyboard::KeyboardController::GetInstance()); |
| 438 } | 438 } |
| 439 | 439 |
| 440 void Shell::DeactivateKeyboard() { | 440 void Shell::DeactivateKeyboard() { |
| 441 keyboard_ui_->Hide(); | 441 // TODO(jamescook): Move keyboard create and hide into WmShell. |
| 442 wm_shell_->keyboard_ui()->Hide(); |
| 442 if (in_mus_) | 443 if (in_mus_) |
| 443 return; | 444 return; |
| 444 if (keyboard::KeyboardController::GetInstance()) { | 445 if (keyboard::KeyboardController::GetInstance()) { |
| 445 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 446 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| 446 for (RootWindowControllerList::iterator iter = controllers.begin(); | 447 for (RootWindowControllerList::iterator iter = controllers.begin(); |
| 447 iter != controllers.end(); ++iter) { | 448 iter != controllers.end(); ++iter) { |
| 448 (*iter)->DeactivateKeyboard(keyboard::KeyboardController::GetInstance()); | 449 (*iter)->DeactivateKeyboard(keyboard::KeyboardController::GetInstance()); |
| 449 } | 450 } |
| 450 } | 451 } |
| 451 keyboard::KeyboardController::ResetInstance(nullptr); | 452 keyboard::KeyboardController::ResetInstance(nullptr); |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1045 | 1046 |
| 1046 #if defined(OS_CHROMEOS) | 1047 #if defined(OS_CHROMEOS) |
| 1047 // Create TouchTransformerController before | 1048 // Create TouchTransformerController before |
| 1048 // WindowTreeHostManager::InitDisplays() | 1049 // WindowTreeHostManager::InitDisplays() |
| 1049 // since TouchTransformerController listens on | 1050 // since TouchTransformerController listens on |
| 1050 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). | 1051 // WindowTreeHostManager::Observer::OnDisplaysInitialized(). |
| 1051 if (!in_mus_) | 1052 if (!in_mus_) |
| 1052 touch_transformer_controller_.reset(new TouchTransformerController()); | 1053 touch_transformer_controller_.reset(new TouchTransformerController()); |
| 1053 #endif // defined(OS_CHROMEOS) | 1054 #endif // defined(OS_CHROMEOS) |
| 1054 | 1055 |
| 1055 keyboard_ui_ = init_params.keyboard_factory.is_null() | 1056 wm_shell_->SetKeyboardUI(init_params.keyboard_factory.is_null() |
| 1056 ? KeyboardUI::Create() | 1057 ? KeyboardUI::Create() |
| 1057 : init_params.keyboard_factory.Run(); | 1058 : init_params.keyboard_factory.Run()); |
| 1058 | 1059 |
| 1059 window_tree_host_manager_->InitHosts(); | 1060 window_tree_host_manager_->InitHosts(); |
| 1060 | 1061 |
| 1061 #if defined(OS_CHROMEOS) | 1062 #if defined(OS_CHROMEOS) |
| 1062 // Needs to be created after InitDisplays() since it may cause the virtual | 1063 // Needs to be created after InitDisplays() since it may cause the virtual |
| 1063 // keyboard to be deployed. | 1064 // keyboard to be deployed. |
| 1064 virtual_keyboard_controller_.reset(new VirtualKeyboardController); | 1065 virtual_keyboard_controller_.reset(new VirtualKeyboardController); |
| 1065 #endif // defined(OS_CHROMEOS) | 1066 #endif // defined(OS_CHROMEOS) |
| 1066 | 1067 |
| 1067 #if defined(OS_CHROMEOS) | 1068 #if defined(OS_CHROMEOS) |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1182 | 1183 |
| 1183 void Shell::OnWindowActivated( | 1184 void Shell::OnWindowActivated( |
| 1184 aura::client::ActivationChangeObserver::ActivationReason reason, | 1185 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1185 aura::Window* gained_active, | 1186 aura::Window* gained_active, |
| 1186 aura::Window* lost_active) { | 1187 aura::Window* lost_active) { |
| 1187 if (gained_active) | 1188 if (gained_active) |
| 1188 target_root_window_ = gained_active->GetRootWindow(); | 1189 target_root_window_ = gained_active->GetRootWindow(); |
| 1189 } | 1190 } |
| 1190 | 1191 |
| 1191 } // namespace ash | 1192 } // namespace ash |
| OLD | NEW |