| 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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 | 557 |
| 558 void WmWindowMus::ReleaseCapture() { | 558 void WmWindowMus::ReleaseCapture() { |
| 559 window_->ReleaseCapture(); | 559 window_->ReleaseCapture(); |
| 560 } | 560 } |
| 561 | 561 |
| 562 bool WmWindowMus::HasRestoreBounds() const { | 562 bool WmWindowMus::HasRestoreBounds() const { |
| 563 return restore_bounds_in_screen_.get() != nullptr; | 563 return restore_bounds_in_screen_.get() != nullptr; |
| 564 } | 564 } |
| 565 | 565 |
| 566 bool WmWindowMus::CanMaximize() const { | 566 bool WmWindowMus::CanMaximize() const { |
| 567 return widget_ ? widget_->widget_delegate()->CanMaximize() : false; | 567 return (GetResizeBehavior(window_) & |
| 568 ::ui::mojom::kResizeBehaviorCanMaximize) != 0; |
| 568 } | 569 } |
| 569 | 570 |
| 570 bool WmWindowMus::CanMinimize() const { | 571 bool WmWindowMus::CanMinimize() const { |
| 571 return widget_ ? widget_->widget_delegate()->CanMinimize() : false; | 572 return (GetResizeBehavior(window_) & |
| 573 ::ui::mojom::kResizeBehaviorCanMinimize) != 0; |
| 572 } | 574 } |
| 573 | 575 |
| 574 bool WmWindowMus::CanResize() const { | 576 bool WmWindowMus::CanResize() const { |
| 575 return widget_ ? widget_->widget_delegate()->CanResize() : false; | 577 return window_ && |
| 578 (GetResizeBehavior(window_) & ::ui::mojom::kResizeBehaviorCanResize) != |
| 579 0; |
| 576 } | 580 } |
| 577 | 581 |
| 578 bool WmWindowMus::CanActivate() const { | 582 bool WmWindowMus::CanActivate() const { |
| 579 // TODO(sky): this isn't quite right. Should key off CanFocus(), which is not | 583 // TODO(sky): this isn't quite right. Should key off CanFocus(), which is not |
| 580 // replicated. | 584 // replicated. |
| 581 return widget_ != nullptr; | 585 return widget_ != nullptr; |
| 582 } | 586 } |
| 583 | 587 |
| 584 void WmWindowMus::StackChildAtTop(WmWindow* child) { | 588 void WmWindowMus::StackChildAtTop(WmWindow* child) { |
| 585 GetMusWindow(child)->MoveToFront(); | 589 GetMusWindow(child)->MoveToFront(); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 void WmWindowMus::OnWindowDestroying(ui::Window* window) { | 822 void WmWindowMus::OnWindowDestroying(ui::Window* window) { |
| 819 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); | 823 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); |
| 820 } | 824 } |
| 821 | 825 |
| 822 void WmWindowMus::OnWindowDestroyed(ui::Window* window) { | 826 void WmWindowMus::OnWindowDestroyed(ui::Window* window) { |
| 823 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroyed(this)); | 827 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroyed(this)); |
| 824 } | 828 } |
| 825 | 829 |
| 826 } // namespace mus | 830 } // namespace mus |
| 827 } // namespace ash | 831 } // namespace ash |
| OLD | NEW |