OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/wm/aura/wm_root_window_controller_aura.h" | 5 #include "ash/aura/wm_root_window_controller_aura.h" |
6 | 6 |
7 #include "ash/common/wm/wm_root_window_controller_observer.h" | 7 #include "ash/aura/wm_shelf_aura.h" |
| 8 #include "ash/aura/wm_shell_aura.h" |
| 9 #include "ash/aura/wm_window_aura.h" |
| 10 #include "ash/common/wm_root_window_controller_observer.h" |
8 #include "ash/display/window_tree_host_manager.h" | 11 #include "ash/display/window_tree_host_manager.h" |
9 #include "ash/root_window_controller.h" | 12 #include "ash/root_window_controller.h" |
10 #include "ash/shelf/shelf.h" | 13 #include "ash/shelf/shelf.h" |
11 #include "ash/shelf/shelf_widget.h" | 14 #include "ash/shelf/shelf_widget.h" |
12 #include "ash/shell.h" | 15 #include "ash/shell.h" |
13 #include "ash/wm/aura/wm_globals_aura.h" | |
14 #include "ash/wm/aura/wm_shelf_aura.h" | |
15 #include "ash/wm/aura/wm_window_aura.h" | |
16 #include "ash/wm/workspace_controller.h" | 16 #include "ash/wm/workspace_controller.h" |
17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
18 #include "ui/aura/window_property.h" | 18 #include "ui/aura/window_property.h" |
19 #include "ui/events/event_targeter.h" | 19 #include "ui/events/event_targeter.h" |
20 #include "ui/events/event_utils.h" | 20 #include "ui/events/event_utils.h" |
21 | 21 |
22 DECLARE_WINDOW_PROPERTY_TYPE(ash::wm::WmRootWindowControllerAura*); | 22 DECLARE_WINDOW_PROPERTY_TYPE(ash::WmRootWindowControllerAura*); |
23 | 23 |
24 namespace ash { | 24 namespace ash { |
25 namespace wm { | |
26 | 25 |
27 // TODO(sky): it likely makes more sense to hang this off RootWindowSettings. | 26 // TODO(sky): it likely makes more sense to hang this off RootWindowSettings. |
28 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ash::wm::WmRootWindowControllerAura, | 27 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ash::WmRootWindowControllerAura, |
29 kWmRootWindowControllerKey, | 28 kWmRootWindowControllerKey, |
30 nullptr); | 29 nullptr); |
31 | 30 |
32 WmRootWindowControllerAura::WmRootWindowControllerAura( | 31 WmRootWindowControllerAura::WmRootWindowControllerAura( |
33 RootWindowController* root_window_controller) | 32 RootWindowController* root_window_controller) |
34 : root_window_controller_(root_window_controller) { | 33 : root_window_controller_(root_window_controller) { |
35 root_window_controller_->GetRootWindow()->SetProperty( | 34 root_window_controller_->GetRootWindow()->SetProperty( |
36 kWmRootWindowControllerKey, this); | 35 kWmRootWindowControllerKey, this); |
37 Shell::GetInstance()->AddShellObserver(this); | 36 Shell::GetInstance()->AddShellObserver(this); |
38 } | 37 } |
(...skipping 20 matching lines...) Expand all Loading... |
59 return wm_root_window_controller; | 58 return wm_root_window_controller; |
60 | 59 |
61 // WmRootWindowControllerAura is owned by the RootWindowController's window. | 60 // WmRootWindowControllerAura is owned by the RootWindowController's window. |
62 return new WmRootWindowControllerAura(root_window_controller); | 61 return new WmRootWindowControllerAura(root_window_controller); |
63 } | 62 } |
64 | 63 |
65 bool WmRootWindowControllerAura::HasShelf() { | 64 bool WmRootWindowControllerAura::HasShelf() { |
66 return root_window_controller_->shelf_widget() != nullptr; | 65 return root_window_controller_->shelf_widget() != nullptr; |
67 } | 66 } |
68 | 67 |
69 WmGlobals* WmRootWindowControllerAura::GetGlobals() { | 68 WmShell* WmRootWindowControllerAura::GetShell() { |
70 return WmGlobals::Get(); | 69 return WmShell::Get(); |
71 } | 70 } |
72 | 71 |
73 WorkspaceWindowState WmRootWindowControllerAura::GetWorkspaceWindowState() { | 72 wm::WorkspaceWindowState WmRootWindowControllerAura::GetWorkspaceWindowState() { |
74 return root_window_controller_->workspace_controller()->GetWindowState(); | 73 return root_window_controller_->workspace_controller()->GetWindowState(); |
75 } | 74 } |
76 | 75 |
77 AlwaysOnTopController* WmRootWindowControllerAura::GetAlwaysOnTopController() { | 76 AlwaysOnTopController* WmRootWindowControllerAura::GetAlwaysOnTopController() { |
78 return root_window_controller_->always_on_top_controller(); | 77 return root_window_controller_->always_on_top_controller(); |
79 } | 78 } |
80 | 79 |
81 WmShelf* WmRootWindowControllerAura::GetShelf() { | 80 wm::WmShelf* WmRootWindowControllerAura::GetShelf() { |
82 return root_window_controller_->shelf_widget() | 81 return root_window_controller_->shelf_widget() |
83 ? root_window_controller_->shelf_widget()->shelf()->wm_shelf() | 82 ? root_window_controller_->shelf_widget()->shelf()->wm_shelf() |
84 : nullptr; | 83 : nullptr; |
85 } | 84 } |
86 | 85 |
87 WmWindow* WmRootWindowControllerAura::GetWindow() { | 86 WmWindow* WmRootWindowControllerAura::GetWindow() { |
88 return WmWindowAura::Get(root_window_controller_->GetRootWindow()); | 87 return WmWindowAura::Get(root_window_controller_->GetRootWindow()); |
89 } | 88 } |
90 | 89 |
91 void WmRootWindowControllerAura::ConfigureWidgetInitParamsForContainer( | 90 void WmRootWindowControllerAura::ConfigureWidgetInitParamsForContainer( |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 136 |
138 void WmRootWindowControllerAura::OnShelfAlignmentChanged( | 137 void WmRootWindowControllerAura::OnShelfAlignmentChanged( |
139 aura::Window* root_window) { | 138 aura::Window* root_window) { |
140 if (root_window != root_window_controller_->GetRootWindow()) | 139 if (root_window != root_window_controller_->GetRootWindow()) |
141 return; | 140 return; |
142 | 141 |
143 FOR_EACH_OBSERVER(WmRootWindowControllerObserver, observers_, | 142 FOR_EACH_OBSERVER(WmRootWindowControllerObserver, observers_, |
144 OnShelfAlignmentChanged()); | 143 OnShelfAlignmentChanged()); |
145 } | 144 } |
146 | 145 |
147 } // namespace wm | |
148 } // namespace ash | 146 } // namespace ash |
OLD | NEW |