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" |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 return; | 789 return; |
790 } | 790 } |
791 ResizeShadowController* resize_shadow_controller = | 791 ResizeShadowController* resize_shadow_controller = |
792 Shell::GetInstance()->resize_shadow_controller(); | 792 Shell::GetInstance()->resize_shadow_controller(); |
793 if (resize_shadow_controller) | 793 if (resize_shadow_controller) |
794 resize_shadow_controller->HideShadow(window_); | 794 resize_shadow_controller->HideShadow(window_); |
795 } | 795 } |
796 | 796 |
797 void WmWindowAura::InstallResizeHandleWindowTargeter( | 797 void WmWindowAura::InstallResizeHandleWindowTargeter( |
798 ImmersiveFullscreenController* immersive_fullscreen_controller) { | 798 ImmersiveFullscreenController* immersive_fullscreen_controller) { |
799 if (aura::Env::GetInstance()->mode() == aura::Env::Mode::MUS) { | |
800 // TODO(sky): I believe once ImmersiveFullscreenController is ported this | |
801 // won't be necessary in mash, but I need to verify that: | |
802 // http://crbug.com/548435. | |
803 return; | |
804 } | |
805 window_->SetEventTargeter(base::MakeUnique<ResizeHandleWindowTargeter>( | 799 window_->SetEventTargeter(base::MakeUnique<ResizeHandleWindowTargeter>( |
806 window_, immersive_fullscreen_controller)); | 800 window_, immersive_fullscreen_controller)); |
807 } | 801 } |
808 | 802 |
809 void WmWindowAura::SetBoundsInScreenBehaviorForChildren( | 803 void WmWindowAura::SetBoundsInScreenBehaviorForChildren( |
810 BoundsInScreenBehavior behavior) { | 804 BoundsInScreenBehavior behavior) { |
811 window_->SetProperty( | 805 window_->SetProperty( |
812 kUsesScreenCoordinatesKey, | 806 kUsesScreenCoordinatesKey, |
813 behavior == BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 807 behavior == BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
814 } | 808 } |
815 | 809 |
816 void WmWindowAura::SetSnapsChildrenToPhysicalPixelBoundary() { | 810 void WmWindowAura::SetSnapsChildrenToPhysicalPixelBoundary() { |
817 wm::SetSnapsChildrenToPhysicalPixelBoundary(window_); | 811 wm::SetSnapsChildrenToPhysicalPixelBoundary(window_); |
818 } | 812 } |
819 | 813 |
820 void WmWindowAura::SnapToPixelBoundaryIfNecessary() { | 814 void WmWindowAura::SnapToPixelBoundaryIfNecessary() { |
821 wm::SnapWindowToPixelBoundary(window_); | 815 wm::SnapWindowToPixelBoundary(window_); |
822 } | 816 } |
823 | 817 |
824 void WmWindowAura::SetChildrenUseExtendedHitRegion() { | 818 void WmWindowAura::SetChildrenUseExtendedHitRegion() { |
825 children_use_extended_hit_region_ = true; | 819 children_use_extended_hit_region_ = true; |
826 if (aura::Env::GetInstance()->mode() == aura::Env::Mode::MUS) | |
827 return; | |
828 | |
829 gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize, | 820 gfx::Insets mouse_extend(-kResizeOutsideBoundsSize, -kResizeOutsideBoundsSize, |
830 -kResizeOutsideBoundsSize, | 821 -kResizeOutsideBoundsSize, |
831 -kResizeOutsideBoundsSize); | 822 -kResizeOutsideBoundsSize); |
832 gfx::Insets touch_extend = | 823 gfx::Insets touch_extend = |
833 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); | 824 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); |
| 825 // TODO: EasyResizeWindowTargeter makes it so children get events outside |
| 826 // their bounds. This only works in mash when mash is providing the non-client |
| 827 // frame. Mus needs to support an api for the WindowManager that enables |
| 828 // events to be dispatched to windows outside the windows bounds that this |
| 829 // function calls into. http://crbug.com/679056. |
834 window_->SetEventTargeter(base::MakeUnique<::wm::EasyResizeWindowTargeter>( | 830 window_->SetEventTargeter(base::MakeUnique<::wm::EasyResizeWindowTargeter>( |
835 window_, mouse_extend, touch_extend)); | 831 window_, mouse_extend, touch_extend)); |
836 } | 832 } |
837 | 833 |
838 std::unique_ptr<views::View> WmWindowAura::CreateViewWithRecreatedLayers() { | 834 std::unique_ptr<views::View> WmWindowAura::CreateViewWithRecreatedLayers() { |
839 return base::MakeUnique<wm::WindowMirrorView>(this); | 835 return base::MakeUnique<wm::WindowMirrorView>(this); |
840 } | 836 } |
841 | 837 |
842 void WmWindowAura::AddObserver(WmWindowObserver* observer) { | 838 void WmWindowAura::AddObserver(WmWindowObserver* observer) { |
843 observers_.AddObserver(observer); | 839 observers_.AddObserver(observer); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 observer.OnTransientChildAdded(this, Get(transient)); | 991 observer.OnTransientChildAdded(this, Get(transient)); |
996 } | 992 } |
997 | 993 |
998 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, | 994 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, |
999 aura::Window* transient) { | 995 aura::Window* transient) { |
1000 for (auto& observer : transient_observers_) | 996 for (auto& observer : transient_observers_) |
1001 observer.OnTransientChildRemoved(this, Get(transient)); | 997 observer.OnTransientChildRemoved(this, Get(transient)); |
1002 } | 998 } |
1003 | 999 |
1004 } // namespace ash | 1000 } // namespace ash |
OLD | NEW |