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/drag_drop/drag_image_view.h" | 11 #include "ash/drag_drop/drag_image_view.h" |
12 #include "ash/mus/accelerators/accelerator_handler.h" | 12 #include "ash/mus/accelerators/accelerator_handler.h" |
13 #include "ash/mus/accelerators/accelerator_ids.h" | 13 #include "ash/mus/accelerators/accelerator_ids.h" |
14 #include "ash/mus/bridge/shell_port_mash.h" | 14 #include "ash/mus/bridge/shell_port_mash.h" |
15 #include "ash/mus/move_event_handler.h" | 15 #include "ash/mus/move_event_handler.h" |
16 #include "ash/mus/non_client_frame_controller.h" | 16 #include "ash/mus/non_client_frame_controller.h" |
17 #include "ash/mus/property_util.h" | 17 #include "ash/mus/property_util.h" |
18 #include "ash/mus/screen_mus.h" | 18 #include "ash/mus/screen_mus.h" |
19 #include "ash/mus/shell_delegate_mus.h" | 19 #include "ash/mus/shell_delegate_mus.h" |
20 #include "ash/mus/top_level_window_factory.h" | 20 #include "ash/mus/top_level_window_factory.h" |
21 #include "ash/mus/window_properties.h" | 21 #include "ash/mus/window_properties.h" |
22 #include "ash/public/cpp/config.h" | 22 #include "ash/public/cpp/config.h" |
23 #include "ash/public/cpp/shelf_types.h" | 23 #include "ash/public/cpp/shelf_types.h" |
24 #include "ash/public/cpp/shell_window_ids.h" | 24 #include "ash/public/cpp/shell_window_ids.h" |
msw
2017/04/26 23:01:08
nit: remove if no longer needed
sky
2017/04/26 23:30:27
Done.
| |
25 #include "ash/public/cpp/window_pin_type.h" | 25 #include "ash/public/cpp/window_pin_type.h" |
26 #include "ash/public/cpp/window_properties.h" | 26 #include "ash/public/cpp/window_properties.h" |
27 #include "ash/public/interfaces/window_pin_type.mojom.h" | 27 #include "ash/public/interfaces/window_pin_type.mojom.h" |
28 #include "ash/root_window_controller.h" | 28 #include "ash/root_window_controller.h" |
29 #include "ash/root_window_settings.h" | 29 #include "ash/root_window_settings.h" |
30 #include "ash/session/session_controller.h" | 30 #include "ash/session/session_controller.h" |
31 #include "ash/shell.h" | 31 #include "ash/shell.h" |
32 #include "ash/shell_init_params.h" | 32 #include "ash/shell_init_params.h" |
33 #include "ash/wm/ash_focus_rules.h" | 33 #include "ash/wm/ash_focus_rules.h" |
34 #include "ash/wm/container_finder.h" | 34 #include "ash/wm/container_finder.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
242 void WindowManager::CreateAndRegisterRootWindowController( | 242 void WindowManager::CreateAndRegisterRootWindowController( |
243 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, | 243 std::unique_ptr<aura::WindowTreeHostMus> window_tree_host, |
244 const display::Display& display, | 244 const display::Display& display, |
245 RootWindowController::RootWindowType root_window_type) { | 245 RootWindowController::RootWindowType root_window_type) { |
246 RootWindowSettings* root_window_settings = | 246 RootWindowSettings* root_window_settings = |
247 InitRootWindowSettings(window_tree_host->window()); | 247 InitRootWindowSettings(window_tree_host->window()); |
248 root_window_settings->display_id = display.id(); | 248 root_window_settings->display_id = display.id(); |
249 std::unique_ptr<RootWindowController> root_window_controller( | 249 std::unique_ptr<RootWindowController> root_window_controller( |
250 new RootWindowController(nullptr, window_tree_host.release())); | 250 new RootWindowController(nullptr, window_tree_host.release())); |
251 root_window_controller->Init(root_window_type); | 251 root_window_controller->Init(root_window_type); |
252 // TODO: To avoid lots of IPC AddActivationParent() should take an array. | |
253 // http://crbug.com/682048. | |
254 aura::Window* root_window = root_window_controller->GetRootWindow(); | |
255 for (size_t i = 0; i < kNumActivatableShellWindowIds; ++i) { | |
256 window_manager_client_->AddActivationParent( | |
257 root_window->GetChildById(kActivatableShellWindowIds[i])); | |
258 } | |
259 root_window_controllers_.insert(std::move(root_window_controller)); | 252 root_window_controllers_.insert(std::move(root_window_controller)); |
260 } | 253 } |
261 | 254 |
262 void WindowManager::DestroyRootWindowController( | 255 void WindowManager::DestroyRootWindowController( |
263 RootWindowController* root_window_controller, | 256 RootWindowController* root_window_controller, |
264 bool in_shutdown) { | 257 bool in_shutdown) { |
265 if (!in_shutdown && root_window_controllers_.size() > 1) { | 258 if (!in_shutdown && root_window_controllers_.size() > 1) { |
266 DCHECK_NE(root_window_controller, GetPrimaryRootWindowController()); | 259 DCHECK_NE(root_window_controller, GetPrimaryRootWindowController()); |
267 root_window_controller->MoveWindowsTo( | 260 root_window_controller->MoveWindowsTo( |
268 GetPrimaryRootWindowController()->GetRootWindow()); | 261 GetPrimaryRootWindowController()->GetRootWindow()); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
568 bool WindowManager::IsWindowActive(aura::Window* window) { | 561 bool WindowManager::IsWindowActive(aura::Window* window) { |
569 return Shell::Get()->activation_client()->GetActiveWindow() == window; | 562 return Shell::Get()->activation_client()->GetActiveWindow() == window; |
570 } | 563 } |
571 | 564 |
572 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { | 565 void WindowManager::OnWmDeactivateWindow(aura::Window* window) { |
573 Shell::Get()->activation_client()->DeactivateWindow(window); | 566 Shell::Get()->activation_client()->DeactivateWindow(window); |
574 } | 567 } |
575 | 568 |
576 } // namespace mus | 569 } // namespace mus |
577 } // namespace ash | 570 } // namespace ash |
OLD | NEW |