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/wm/container_finder.h" | 11 #include "ash/common/wm/container_finder.h" |
12 #include "ash/common/wm/window_state.h" | 12 #include "ash/common/wm/window_state.h" |
13 #include "ash/common/wm_root_window_controller.h" | |
14 #include "ash/display/screen_position_controller.h" | 13 #include "ash/display/screen_position_controller.h" |
15 #include "ash/mus/accelerators/accelerator_handler.h" | 14 #include "ash/mus/accelerators/accelerator_handler.h" |
16 #include "ash/mus/accelerators/accelerator_ids.h" | 15 #include "ash/mus/accelerators/accelerator_ids.h" |
17 #include "ash/mus/bridge/wm_lookup_mus.h" | 16 #include "ash/mus/bridge/wm_lookup_mus.h" |
18 #include "ash/mus/bridge/wm_shell_mus.h" | 17 #include "ash/mus/bridge/wm_shell_mus.h" |
19 #include "ash/mus/bridge/wm_window_mus.h" | 18 #include "ash/mus/bridge/wm_window_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" |
23 #include "ash/mus/root_window_controller.h" | 22 #include "ash/mus/root_window_controller.h" |
24 #include "ash/mus/screen_mus.h" | 23 #include "ash/mus/screen_mus.h" |
25 #include "ash/mus/shadow_controller.h" | 24 #include "ash/mus/shadow_controller.h" |
26 #include "ash/mus/shell_delegate_mus.h" | 25 #include "ash/mus/shell_delegate_mus.h" |
27 #include "ash/mus/window_manager_observer.h" | 26 #include "ash/mus/window_manager_observer.h" |
28 #include "ash/mus/window_properties.h" | 27 #include "ash/mus/window_properties.h" |
29 #include "ash/public/cpp/shell_window_ids.h" | 28 #include "ash/public/cpp/shell_window_ids.h" |
| 29 #include "ash/root_window_controller.h" |
30 #include "ash/shell.h" | 30 #include "ash/shell.h" |
31 #include "ash/wm/ash_focus_rules.h" | 31 #include "ash/wm/ash_focus_rules.h" |
32 #include "ash/wm/event_client_impl.h" | 32 #include "ash/wm/event_client_impl.h" |
33 #include "ash/wm/window_properties.h" | 33 #include "ash/wm/window_properties.h" |
34 #include "base/memory/ptr_util.h" | 34 #include "base/memory/ptr_util.h" |
35 #include "services/service_manager/public/cpp/connector.h" | 35 #include "services/service_manager/public/cpp/connector.h" |
36 #include "services/ui/common/accelerator_util.h" | 36 #include "services/ui/common/accelerator_util.h" |
37 #include "services/ui/common/types.h" | 37 #include "services/ui/common/types.h" |
38 #include "services/ui/public/cpp/property_type_converters.h" | 38 #include "services/ui/public/cpp/property_type_converters.h" |
39 #include "services/ui/public/interfaces/constants.mojom.h" | 39 #include "services/ui/public/interfaces/constants.mojom.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 std::unique_ptr<RootWindowController> root_window_controller_ptr( | 224 std::unique_ptr<RootWindowController> root_window_controller_ptr( |
225 new RootWindowController(this, std::move(window_tree_host), display, | 225 new RootWindowController(this, std::move(window_tree_host), display, |
226 root_window_type)); | 226 root_window_type)); |
227 RootWindowController* root_window_controller = | 227 RootWindowController* root_window_controller = |
228 root_window_controller_ptr.get(); | 228 root_window_controller_ptr.get(); |
229 root_window_controllers_.insert(std::move(root_window_controller_ptr)); | 229 root_window_controllers_.insert(std::move(root_window_controller_ptr)); |
230 | 230 |
231 // TODO: this should be called when logged in. See http://crbug.com/654606. | 231 // TODO: this should be called when logged in. See http://crbug.com/654606. |
232 root_window_controller->ash_root_window_controller() | 232 root_window_controller->ash_root_window_controller() |
233 ->wm_root_window_controller() | |
234 ->CreateShelf(); | 233 ->CreateShelf(); |
235 | 234 |
236 for (auto& observer : observers_) | 235 for (auto& observer : observers_) |
237 observer.OnRootWindowControllerAdded(root_window_controller); | 236 observer.OnRootWindowControllerAdded(root_window_controller); |
238 | 237 |
239 for (auto& observer : *screen_->display_list().observers()) | 238 for (auto& observer : *screen_->display_list().observers()) |
240 observer.OnDisplayAdded(root_window_controller->display()); | 239 observer.OnDisplayAdded(root_window_controller->display()); |
241 | 240 |
242 return root_window_controller; | 241 return root_window_controller; |
243 } | 242 } |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 512 |
514 void WindowManager::OnWindowInitialized(aura::Window* window) { | 513 void WindowManager::OnWindowInitialized(aura::Window* window) { |
515 // This ensures WmWindowAura won't be called before WmWindowMus. This is | 514 // This ensures WmWindowAura won't be called before WmWindowMus. This is |
516 // important as if WmWindowAura::Get() is called first, then WmWindowAura | 515 // important as if WmWindowAura::Get() is called first, then WmWindowAura |
517 // would be created, not WmWindowMus. | 516 // would be created, not WmWindowMus. |
518 WmWindowMus::Get(window); | 517 WmWindowMus::Get(window); |
519 } | 518 } |
520 | 519 |
521 } // namespace mus | 520 } // namespace mus |
522 } // namespace ash | 521 } // namespace ash |
OLD | NEW |