| 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_state.h" | 8 #include "ash/common/wm/window_state.h" |
| 9 #include "ash/common/wm_layout_manager.h" | 9 #include "ash/common/wm_layout_manager.h" |
| 10 #include "ash/common/wm_window_observer.h" | 10 #include "ash/common/wm_window_observer.h" |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 } | 345 } |
| 346 | 346 |
| 347 const wm::WindowState* WmWindowMus::GetWindowState() const { | 347 const wm::WindowState* WmWindowMus::GetWindowState() const { |
| 348 return window_state_.get(); | 348 return window_state_.get(); |
| 349 } | 349 } |
| 350 | 350 |
| 351 WmWindow* WmWindowMus::GetToplevelWindow() { | 351 WmWindow* WmWindowMus::GetToplevelWindow() { |
| 352 return WmShellMus::GetToplevelAncestor(window_); | 352 return WmShellMus::GetToplevelAncestor(window_); |
| 353 } | 353 } |
| 354 | 354 |
| 355 WmWindow* WmWindowMus::GetToplevelWindowForFocus() { |
| 356 // TODO(sky): resolve if we really need two notions of top-level. In the mus |
| 357 // world they are the same. |
| 358 return WmShellMus::GetToplevelAncestor(window_); |
| 359 } |
| 360 |
| 355 void WmWindowMus::SetParentUsingContext(WmWindow* context, | 361 void WmWindowMus::SetParentUsingContext(WmWindow* context, |
| 356 const gfx::Rect& screen_bounds) { | 362 const gfx::Rect& screen_bounds) { |
| 357 wm::GetDefaultParent(context, this, screen_bounds)->AddChild(this); | 363 wm::GetDefaultParent(context, this, screen_bounds)->AddChild(this); |
| 358 } | 364 } |
| 359 | 365 |
| 360 void WmWindowMus::AddChild(WmWindow* window) { | 366 void WmWindowMus::AddChild(WmWindow* window) { |
| 361 window_->AddChild(GetMusWindow(window)); | 367 window_->AddChild(GetMusWindow(window)); |
| 362 } | 368 } |
| 363 | 369 |
| 364 WmWindow* WmWindowMus::GetParent() { | 370 WmWindow* WmWindowMus::GetParent() { |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 void WmWindowMus::OnWindowDestroying(::ui::Window* window) { | 794 void WmWindowMus::OnWindowDestroying(::ui::Window* window) { |
| 789 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); | 795 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); |
| 790 } | 796 } |
| 791 | 797 |
| 792 void WmWindowMus::OnWindowDestroyed(::ui::Window* window) { | 798 void WmWindowMus::OnWindowDestroyed(::ui::Window* window) { |
| 793 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroyed(this)); | 799 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroyed(this)); |
| 794 } | 800 } |
| 795 | 801 |
| 796 } // namespace mus | 802 } // namespace mus |
| 797 } // namespace ash | 803 } // namespace ash |
| OLD | NEW |