| 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/shelf/shelf_item_types.h" | 7 #include "ash/common/shelf/shelf_item_types.h" |
| 8 #include "ash/common/wm/container_finder.h" | 8 #include "ash/common/wm/container_finder.h" |
| 9 #include "ash/common/wm/window_positioning_utils.h" | 9 #include "ash/common/wm/window_positioning_utils.h" |
| 10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 return window_->bounds(); | 613 return window_->bounds(); |
| 614 } | 614 } |
| 615 | 615 |
| 616 gfx::Rect WmWindowMus::GetTargetBounds() { | 616 gfx::Rect WmWindowMus::GetTargetBounds() { |
| 617 // TODO: need animation support: http://crbug.com/615087. | 617 // TODO: need animation support: http://crbug.com/615087. |
| 618 NOTIMPLEMENTED(); | 618 NOTIMPLEMENTED(); |
| 619 return window_->bounds(); | 619 return window_->bounds(); |
| 620 } | 620 } |
| 621 | 621 |
| 622 void WmWindowMus::ClearRestoreBounds() { | 622 void WmWindowMus::ClearRestoreBounds() { |
| 623 restore_bounds_in_screen_.reset(); | 623 window_->ClearSharedProperty( |
| 624 ui::mojom::WindowManager::kRestoreBounds_Property); |
| 624 } | 625 } |
| 625 | 626 |
| 626 void WmWindowMus::SetRestoreBoundsInScreen(const gfx::Rect& bounds) { | 627 void WmWindowMus::SetRestoreBoundsInScreen(const gfx::Rect& bounds) { |
| 627 restore_bounds_in_screen_.reset(new gfx::Rect(bounds)); | 628 SetRestoreBounds(window_, bounds); |
| 628 } | 629 } |
| 629 | 630 |
| 630 gfx::Rect WmWindowMus::GetRestoreBoundsInScreen() const { | 631 gfx::Rect WmWindowMus::GetRestoreBoundsInScreen() const { |
| 631 return *restore_bounds_in_screen_; | 632 return GetRestoreBounds(window_); |
| 632 } | 633 } |
| 633 | 634 |
| 634 bool WmWindowMus::Contains(const WmWindow* other) const { | 635 bool WmWindowMus::Contains(const WmWindow* other) const { |
| 635 return other | 636 return other |
| 636 ? window_->Contains( | 637 ? window_->Contains( |
| 637 static_cast<const WmWindowMus*>(other)->window_) | 638 static_cast<const WmWindowMus*>(other)->window_) |
| 638 : false; | 639 : false; |
| 639 } | 640 } |
| 640 | 641 |
| 641 void WmWindowMus::SetShowState(ui::WindowShowState show_state) { | 642 void WmWindowMus::SetShowState(ui::WindowShowState show_state) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 671 | 672 |
| 672 bool WmWindowMus::HasCapture() { | 673 bool WmWindowMus::HasCapture() { |
| 673 return window_->HasCapture(); | 674 return window_->HasCapture(); |
| 674 } | 675 } |
| 675 | 676 |
| 676 void WmWindowMus::ReleaseCapture() { | 677 void WmWindowMus::ReleaseCapture() { |
| 677 window_->ReleaseCapture(); | 678 window_->ReleaseCapture(); |
| 678 } | 679 } |
| 679 | 680 |
| 680 bool WmWindowMus::HasRestoreBounds() const { | 681 bool WmWindowMus::HasRestoreBounds() const { |
| 681 return restore_bounds_in_screen_.get() != nullptr; | 682 return window_->HasSharedProperty( |
| 683 ui::mojom::WindowManager::kRestoreBounds_Property); |
| 682 } | 684 } |
| 683 | 685 |
| 684 bool WmWindowMus::CanMaximize() const { | 686 bool WmWindowMus::CanMaximize() const { |
| 685 return (GetResizeBehavior(window_) & | 687 return (GetResizeBehavior(window_) & |
| 686 ::ui::mojom::kResizeBehaviorCanMaximize) != 0; | 688 ::ui::mojom::kResizeBehaviorCanMaximize) != 0; |
| 687 } | 689 } |
| 688 | 690 |
| 689 bool WmWindowMus::CanMinimize() const { | 691 bool WmWindowMus::CanMinimize() const { |
| 690 return (GetResizeBehavior(window_) & | 692 return (GetResizeBehavior(window_) & |
| 691 ::ui::mojom::kResizeBehaviorCanMinimize) != 0; | 693 ::ui::mojom::kResizeBehaviorCanMinimize) != 0; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 } | 980 } |
| 979 | 981 |
| 980 void WmWindowMus::OnTransientChildRemoved(ui::Window* window, | 982 void WmWindowMus::OnTransientChildRemoved(ui::Window* window, |
| 981 ui::Window* transient) { | 983 ui::Window* transient) { |
| 982 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, | 984 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, |
| 983 OnTransientChildRemoved(this, Get(transient))); | 985 OnTransientChildRemoved(this, Get(transient))); |
| 984 } | 986 } |
| 985 | 987 |
| 986 } // namespace mus | 988 } // namespace mus |
| 987 } // namespace ash | 989 } // namespace ash |
| OLD | NEW |