| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/mus/window_manager.h" | 5 #include "ash/mus/window_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "ash/common/session/session_controller.h" | 11 #include "ash/common/session/session_controller.h" |
| 12 #include "ash/common/system/tray/system_tray_delegate.h" | |
| 13 #include "ash/common/wm/container_finder.h" | 12 #include "ash/common/wm/container_finder.h" |
| 14 #include "ash/common/wm/window_state.h" | 13 #include "ash/common/wm/window_state.h" |
| 15 #include "ash/common/wm_window.h" | 14 #include "ash/common/wm_window.h" |
| 16 #include "ash/mus/accelerators/accelerator_handler.h" | 15 #include "ash/mus/accelerators/accelerator_handler.h" |
| 17 #include "ash/mus/accelerators/accelerator_ids.h" | 16 #include "ash/mus/accelerators/accelerator_ids.h" |
| 18 #include "ash/mus/bridge/wm_lookup_mus.h" | 17 #include "ash/mus/bridge/wm_lookup_mus.h" |
| 19 #include "ash/mus/bridge/wm_shell_mus.h" | 18 #include "ash/mus/bridge/wm_shell_mus.h" |
| 20 #include "ash/mus/move_event_handler.h" | 19 #include "ash/mus/move_event_handler.h" |
| 21 #include "ash/mus/non_client_frame_controller.h" | 20 #include "ash/mus/non_client_frame_controller.h" |
| 22 #include "ash/mus/property_util.h" | 21 #include "ash/mus/property_util.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 CreateAndRegisterRootWindowController( | 182 CreateAndRegisterRootWindowController( |
| 184 std::move(window_tree_host), screen_->GetAllDisplays()[0], | 183 std::move(window_tree_host), screen_->GetAllDisplays()[0], |
| 185 RootWindowController::RootWindowType::PRIMARY); | 184 RootWindowController::RootWindowType::PRIMARY); |
| 186 } | 185 } |
| 187 | 186 |
| 188 void WindowManager::CreateShell( | 187 void WindowManager::CreateShell( |
| 189 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) { | 188 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host) { |
| 190 DCHECK(!created_shell_); | 189 DCHECK(!created_shell_); |
| 191 created_shell_ = true; | 190 created_shell_ = true; |
| 192 ShellInitParams init_params; | 191 ShellInitParams init_params; |
| 193 WmShellMus* wm_shell = | 192 WmShellMus* wm_shell = new WmShellMus( |
| 194 new WmShellMus(WmWindow::Get(window_tree_host->window()), | 193 WmWindow::Get(window_tree_host->window()), |
| 195 base::MakeUnique<ShellDelegateMus>( | 194 shell_delegate_for_test_ ? std::move(shell_delegate_for_test_) |
| 196 connector_, std::move(system_tray_delegate_for_test_)), | 195 : base::MakeUnique<ShellDelegateMus>(connector_), |
| 197 this, pointer_watcher_event_router_.get()); | 196 this, pointer_watcher_event_router_.get()); |
| 198 init_params.primary_window_tree_host = window_tree_host.release(); | 197 init_params.primary_window_tree_host = window_tree_host.release(); |
| 199 init_params.wm_shell = wm_shell; | 198 init_params.wm_shell = wm_shell; |
| 200 init_params.blocking_pool = blocking_pool_.get(); | 199 init_params.blocking_pool = blocking_pool_.get(); |
| 201 Shell::CreateInstance(init_params); | 200 Shell::CreateInstance(init_params); |
| 202 } | 201 } |
| 203 | 202 |
| 204 void WindowManager::CreateAndRegisterRootWindowController( | 203 void WindowManager::CreateAndRegisterRootWindowController( |
| 205 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, | 204 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, |
| 206 const display::Display& display, | 205 const display::Display& display, |
| 207 RootWindowController::RootWindowType root_window_type) { | 206 RootWindowController::RootWindowType root_window_type) { |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 bool WindowManager::IsWindowActive(aura::Window* window) { | 463 bool WindowManager::IsWindowActive(aura::Window* window) { |
| 465 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window; | 464 return Shell::GetInstance()->activation_client()->GetActiveWindow() == window; |
| 466 } | 465 } |
| 467 | 466 |
| 468 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 467 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
| 469 Shell::GetInstance()->activation_client()->DeactivateWindow(window); | 468 Shell::GetInstance()->activation_client()->DeactivateWindow(window); |
| 470 } | 469 } |
| 471 | 470 |
| 472 } // namespace mus | 471 } // namespace mus |
| 473 } // namespace ash | 472 } // namespace ash |
| OLD | NEW |