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/aura/wm_window_aura.h" | 5 #include "ash/aura/wm_window_aura.h" |
6 | 6 |
7 #include "ash/aura/aura_layout_manager_adapter.h" | 7 #include "ash/aura/aura_layout_manager_adapter.h" |
8 #include "ash/aura/wm_root_window_controller_aura.h" | |
9 #include "ash/aura/wm_shell_aura.h" | 8 #include "ash/aura/wm_shell_aura.h" |
10 #include "ash/common/ash_constants.h" | 9 #include "ash/common/ash_constants.h" |
11 #include "ash/common/shelf/shelf_item_types.h" | 10 #include "ash/common/shelf/shelf_item_types.h" |
12 #include "ash/common/wm/window_state.h" | 11 #include "ash/common/wm/window_state.h" |
13 #include "ash/common/wm_layout_manager.h" | 12 #include "ash/common/wm_layout_manager.h" |
14 #include "ash/common/wm_transient_window_observer.h" | 13 #include "ash/common/wm_transient_window_observer.h" |
15 #include "ash/common/wm_window_observer.h" | 14 #include "ash/common/wm_window_observer.h" |
16 #include "ash/common/wm_window_property.h" | 15 #include "ash/common/wm_window_property.h" |
17 #include "ash/public/cpp/shell_window_ids.h" | 16 #include "ash/public/cpp/shell_window_ids.h" |
| 17 #include "ash/root_window_controller.h" |
18 #include "ash/screen_util.h" | 18 #include "ash/screen_util.h" |
19 #include "ash/shell.h" | 19 #include "ash/shell.h" |
20 #include "ash/wm/resize_handle_window_targeter.h" | 20 #include "ash/wm/resize_handle_window_targeter.h" |
21 #include "ash/wm/resize_shadow_controller.h" | 21 #include "ash/wm/resize_shadow_controller.h" |
22 #include "ash/wm/window_animations.h" | 22 #include "ash/wm/window_animations.h" |
23 #include "ash/wm/window_mirror_view.h" | 23 #include "ash/wm/window_mirror_view.h" |
24 #include "ash/wm/window_properties.h" | 24 #include "ash/wm/window_properties.h" |
25 #include "ash/wm/window_state_aura.h" | 25 #include "ash/wm/window_state_aura.h" |
26 #include "ash/wm/window_util.h" | 26 #include "ash/wm/window_util.h" |
27 #include "base/memory/ptr_util.h" | 27 #include "base/memory/ptr_util.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 delete window_; | 145 delete window_; |
146 // WARNING: this has been deleted. | 146 // WARNING: this has been deleted. |
147 } | 147 } |
148 | 148 |
149 const WmWindow* WmWindowAura::GetRootWindow() const { | 149 const WmWindow* WmWindowAura::GetRootWindow() const { |
150 return Get(window_->GetRootWindow()); | 150 return Get(window_->GetRootWindow()); |
151 } | 151 } |
152 | 152 |
153 WmRootWindowController* WmWindowAura::GetRootWindowController() { | 153 WmRootWindowController* WmWindowAura::GetRootWindowController() { |
154 aura::Window* root = window_->GetRootWindow(); | 154 aura::Window* root = window_->GetRootWindow(); |
155 return root ? WmRootWindowControllerAura::Get(root) : nullptr; | 155 if (!root) |
| 156 return nullptr; |
| 157 |
| 158 RootWindowController* rwc = RootWindowController::ForWindow(root); |
| 159 return rwc ? rwc->wm_root_window_controller() : nullptr; |
156 } | 160 } |
157 | 161 |
158 WmShell* WmWindowAura::GetShell() const { | 162 WmShell* WmWindowAura::GetShell() const { |
159 return WmShell::Get(); | 163 return WmShell::Get(); |
160 } | 164 } |
161 | 165 |
162 void WmWindowAura::SetName(const char* name) { | 166 void WmWindowAura::SetName(const char* name) { |
163 window_->SetName(name); | 167 window_->SetName(name); |
164 } | 168 } |
165 | 169 |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 observer.OnTransientChildAdded(this, Get(transient)); | 995 observer.OnTransientChildAdded(this, Get(transient)); |
992 } | 996 } |
993 | 997 |
994 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, | 998 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, |
995 aura::Window* transient) { | 999 aura::Window* transient) { |
996 for (auto& observer : transient_observers_) | 1000 for (auto& observer : transient_observers_) |
997 observer.OnTransientChildRemoved(this, Get(transient)); | 1001 observer.OnTransientChildRemoved(this, Get(transient)); |
998 } | 1002 } |
999 | 1003 |
1000 } // namespace ash | 1004 } // namespace ash |
OLD | NEW |