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/mus/bridge/wm_window_mus.h" | 5 #include "ash/mus/bridge/wm_window_mus.h" |
6 | 6 |
7 #include "ash/common/wm/container_finder.h" | 7 #include "ash/common/wm/container_finder.h" |
8 #include "ash/common/wm/window_positioning_utils.h" | 8 #include "ash/common/wm/window_positioning_utils.h" |
9 #include "ash/common/wm/window_state.h" | 9 #include "ash/common/wm/window_state.h" |
10 #include "ash/common/wm_layout_manager.h" | 10 #include "ash/common/wm_layout_manager.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 bool WmWindowMus::ShouldUseExtendedHitRegion() const { | 154 bool WmWindowMus::ShouldUseExtendedHitRegion() const { |
155 const WmWindowMus* parent = Get(window_->parent()); | 155 const WmWindowMus* parent = Get(window_->parent()); |
156 return parent && parent->children_use_extended_hit_region_; | 156 return parent && parent->children_use_extended_hit_region_; |
157 } | 157 } |
158 | 158 |
159 bool WmWindowMus::IsContainer() const { | 159 bool WmWindowMus::IsContainer() const { |
160 return GetShellWindowId() != kShellWindowId_Invalid; | 160 return GetShellWindowId() != kShellWindowId_Invalid; |
161 } | 161 } |
162 | 162 |
163 void WmWindowMus::Destroy() { | 163 void WmWindowMus::Destroy() { |
| 164 // TODO(sky): to match aura behavior this should delete children. |
| 165 // http://crbug.com/647513. |
164 window_->Destroy(); | 166 window_->Destroy(); |
165 // WARNING: this has been deleted. | 167 // WARNING: this has been deleted. |
166 } | 168 } |
167 | 169 |
168 const WmWindow* WmWindowMus::GetRootWindow() const { | 170 const WmWindow* WmWindowMus::GetRootWindow() const { |
169 return Get(window_->GetRoot()); | 171 return Get(window_->GetRoot()); |
170 } | 172 } |
171 | 173 |
172 WmRootWindowController* WmWindowMus::GetRootWindowController() { | 174 WmRootWindowController* WmWindowMus::GetRootWindowController() { |
173 return GetRootWindowControllerMus(); | 175 return GetRootWindowControllerMus(); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 | 439 |
438 void WmWindowMus::SetParentUsingContext(WmWindow* context, | 440 void WmWindowMus::SetParentUsingContext(WmWindow* context, |
439 const gfx::Rect& screen_bounds) { | 441 const gfx::Rect& screen_bounds) { |
440 wm::GetDefaultParent(context, this, screen_bounds)->AddChild(this); | 442 wm::GetDefaultParent(context, this, screen_bounds)->AddChild(this); |
441 } | 443 } |
442 | 444 |
443 void WmWindowMus::AddChild(WmWindow* window) { | 445 void WmWindowMus::AddChild(WmWindow* window) { |
444 window_->AddChild(GetMusWindow(window)); | 446 window_->AddChild(GetMusWindow(window)); |
445 } | 447 } |
446 | 448 |
| 449 void WmWindowMus::RemoveChild(WmWindow* child) { |
| 450 window_->RemoveChild(GetMusWindow(child)); |
| 451 } |
| 452 |
447 const WmWindow* WmWindowMus::GetParent() const { | 453 const WmWindow* WmWindowMus::GetParent() const { |
448 return Get(window_->parent()); | 454 return Get(window_->parent()); |
449 } | 455 } |
450 | 456 |
451 const WmWindow* WmWindowMus::GetTransientParent() const { | 457 const WmWindow* WmWindowMus::GetTransientParent() const { |
452 return Get(window_->transient_parent()); | 458 return Get(window_->transient_parent()); |
453 } | 459 } |
454 | 460 |
455 std::vector<WmWindow*> WmWindowMus::GetTransientChildren() { | 461 std::vector<WmWindow*> WmWindowMus::GetTransientChildren() { |
456 return FromMusWindows(window_->transient_children()); | 462 return FromMusWindows(window_->transient_children()); |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 } | 929 } |
924 | 930 |
925 void WmWindowMus::OnTransientChildRemoved(ui::Window* window, | 931 void WmWindowMus::OnTransientChildRemoved(ui::Window* window, |
926 ui::Window* transient) { | 932 ui::Window* transient) { |
927 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, | 933 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, |
928 OnTransientChildRemoved(this, Get(transient))); | 934 OnTransientChildRemoved(this, Get(transient))); |
929 } | 935 } |
930 | 936 |
931 } // namespace mus | 937 } // namespace mus |
932 } // namespace ash | 938 } // namespace ash |
OLD | NEW |