| 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" | 8 #include "ash/aura/wm_root_window_controller_aura.h" |
| 9 #include "ash/aura/wm_shell_aura.h" | 9 #include "ash/aura/wm_shell_aura.h" |
| 10 #include "ash/common/ash_constants.h" | 10 #include "ash/common/ash_constants.h" |
| 11 #include "ash/common/shelf/shelf_item_types.h" | 11 #include "ash/common/shelf/shelf_item_types.h" |
| 12 #include "ash/common/wm/window_state.h" | 12 #include "ash/common/wm/window_state.h" |
| 13 #include "ash/common/wm_layout_manager.h" | 13 #include "ash/common/wm_layout_manager.h" |
| 14 #include "ash/common/wm_transient_window_observer.h" | 14 #include "ash/common/wm_transient_window_observer.h" |
| 15 #include "ash/common/wm_window_observer.h" | 15 #include "ash/common/wm_window_observer.h" |
| 16 #include "ash/common/wm_window_property.h" | 16 #include "ash/common/wm_window_property.h" |
| 17 #include "ash/public/cpp/shell_window_ids.h" | 17 #include "ash/public/cpp/shell_window_ids.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" |
| 28 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
| 28 #include "ui/aura/client/aura_constants.h" | 29 #include "ui/aura/client/aura_constants.h" |
| 29 #include "ui/aura/client/focus_client.h" | 30 #include "ui/aura/client/focus_client.h" |
| 30 #include "ui/aura/client/window_parenting_client.h" | 31 #include "ui/aura/client/window_parenting_client.h" |
| 31 #include "ui/aura/layout_manager.h" | 32 #include "ui/aura/layout_manager.h" |
| 32 #include "ui/aura/window.h" | 33 #include "ui/aura/window.h" |
| 33 #include "ui/aura/window_delegate.h" | 34 #include "ui/aura/window_delegate.h" |
| 34 #include "ui/aura/window_property.h" | 35 #include "ui/aura/window_property.h" |
| 35 #include "ui/base/hit_test.h" | 36 #include "ui/base/hit_test.h" |
| 36 #include "ui/compositor/layer_tree_owner.h" | 37 #include "ui/compositor/layer_tree_owner.h" |
| 37 #include "ui/compositor/scoped_layer_animation_settings.h" | 38 #include "ui/compositor/scoped_layer_animation_settings.h" |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 | 627 |
| 627 void WmWindowAura::ReleaseCapture() { | 628 void WmWindowAura::ReleaseCapture() { |
| 628 window_->ReleaseCapture(); | 629 window_->ReleaseCapture(); |
| 629 } | 630 } |
| 630 | 631 |
| 631 bool WmWindowAura::HasRestoreBounds() const { | 632 bool WmWindowAura::HasRestoreBounds() const { |
| 632 return window_->GetProperty(aura::client::kRestoreBoundsKey) != nullptr; | 633 return window_->GetProperty(aura::client::kRestoreBoundsKey) != nullptr; |
| 633 } | 634 } |
| 634 | 635 |
| 635 bool WmWindowAura::CanMaximize() const { | 636 bool WmWindowAura::CanMaximize() const { |
| 636 return window_->GetProperty(aura::client::kCanMaximizeKey); | 637 return (window_->GetProperty(aura::client::kResizeBehaviorKey) & |
| 638 ui::mojom::kResizeBehaviorCanMaximize) != 0; |
| 637 } | 639 } |
| 638 | 640 |
| 639 bool WmWindowAura::CanMinimize() const { | 641 bool WmWindowAura::CanMinimize() const { |
| 640 return window_->GetProperty(aura::client::kCanMinimizeKey); | 642 return (window_->GetProperty(aura::client::kResizeBehaviorKey) & |
| 643 ui::mojom::kResizeBehaviorCanMinimize) != 0; |
| 641 } | 644 } |
| 642 | 645 |
| 643 bool WmWindowAura::CanResize() const { | 646 bool WmWindowAura::CanResize() const { |
| 644 return window_->GetProperty(aura::client::kCanResizeKey); | 647 return (window_->GetProperty(aura::client::kResizeBehaviorKey) & |
| 648 ui::mojom::kResizeBehaviorCanResize) != 0; |
| 645 } | 649 } |
| 646 | 650 |
| 647 bool WmWindowAura::CanActivate() const { | 651 bool WmWindowAura::CanActivate() const { |
| 648 return ::wm::CanActivateWindow(window_); | 652 return ::wm::CanActivateWindow(window_); |
| 649 } | 653 } |
| 650 | 654 |
| 651 void WmWindowAura::StackChildAtTop(WmWindow* child) { | 655 void WmWindowAura::StackChildAtTop(WmWindow* child) { |
| 652 window_->StackChildAtTop(GetAuraWindow(child)); | 656 window_->StackChildAtTop(GetAuraWindow(child)); |
| 653 } | 657 } |
| 654 | 658 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 observer.OnTransientChildAdded(this, Get(transient)); | 939 observer.OnTransientChildAdded(this, Get(transient)); |
| 936 } | 940 } |
| 937 | 941 |
| 938 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, | 942 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, |
| 939 aura::Window* transient) { | 943 aura::Window* transient) { |
| 940 for (auto& observer : transient_observers_) | 944 for (auto& observer : transient_observers_) |
| 941 observer.OnTransientChildRemoved(this, Get(transient)); | 945 observer.OnTransientChildRemoved(this, Get(transient)); |
| 942 } | 946 } |
| 943 | 947 |
| 944 } // namespace ash | 948 } // namespace ash |
| OLD | NEW |