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/wm_window.h" | 5 #include "ash/wm_window.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/public/cpp/config.h" | 8 #include "ash/public/cpp/config.h" |
9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
10 #include "ash/public/cpp/window_properties.h" | 10 #include "ash/public/cpp/window_properties.h" |
11 #include "ash/root_window_controller.h" | 11 #include "ash/root_window_controller.h" |
12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
13 #include "ash/wm/resize_handle_window_targeter.h" | 13 #include "ash/wm/resize_handle_window_targeter.h" |
14 #include "ash/wm/resize_shadow_controller.h" | 14 #include "ash/wm/resize_shadow_controller.h" |
15 #include "ash/wm/widget_finder.h" | 15 #include "ash/wm/widget_finder.h" |
16 #include "ash/wm/window_animations.h" | 16 #include "ash/wm/window_animations.h" |
17 #include "ash/wm/window_mirror_view.h" | |
18 #include "ash/wm/window_properties.h" | 17 #include "ash/wm/window_properties.h" |
19 #include "ash/wm/window_state.h" | 18 #include "ash/wm/window_state.h" |
20 #include "ash/wm/window_state_aura.h" | 19 #include "ash/wm/window_state_aura.h" |
21 #include "ash/wm/window_util.h" | 20 #include "ash/wm/window_util.h" |
22 #include "ash/wm_transient_window_observer.h" | 21 #include "ash/wm_transient_window_observer.h" |
23 #include "base/memory/ptr_util.h" | 22 #include "base/memory/ptr_util.h" |
24 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" | 23 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
25 #include "ui/aura/client/aura_constants.h" | 24 #include "ui/aura/client/aura_constants.h" |
26 #include "ui/aura/client/focus_client.h" | 25 #include "ui/aura/client/focus_client.h" |
27 #include "ui/aura/client/window_parenting_client.h" | 26 #include "ui/aura/client/window_parenting_client.h" |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); | 664 mouse_extend.Scale(kResizeOutsideBoundsScaleForTouch); |
666 // TODO: EasyResizeWindowTargeter makes it so children get events outside | 665 // TODO: EasyResizeWindowTargeter makes it so children get events outside |
667 // their bounds. This only works in mash when mash is providing the non-client | 666 // their bounds. This only works in mash when mash is providing the non-client |
668 // frame. Mus needs to support an api for the WindowManager that enables | 667 // frame. Mus needs to support an api for the WindowManager that enables |
669 // events to be dispatched to windows outside the windows bounds that this | 668 // events to be dispatched to windows outside the windows bounds that this |
670 // function calls into. http://crbug.com/679056. | 669 // function calls into. http://crbug.com/679056. |
671 window_->SetEventTargeter(base::MakeUnique<::wm::EasyResizeWindowTargeter>( | 670 window_->SetEventTargeter(base::MakeUnique<::wm::EasyResizeWindowTargeter>( |
672 window_, mouse_extend, touch_extend)); | 671 window_, mouse_extend, touch_extend)); |
673 } | 672 } |
674 | 673 |
675 std::unique_ptr<views::View> WmWindow::CreateViewWithRecreatedLayers() { | |
676 return base::MakeUnique<wm::WindowMirrorView>(this); | |
677 } | |
678 | |
679 void WmWindow::AddTransientWindowObserver(WmTransientWindowObserver* observer) { | 674 void WmWindow::AddTransientWindowObserver(WmTransientWindowObserver* observer) { |
680 if (!added_transient_observer_) { | 675 if (!added_transient_observer_) { |
681 added_transient_observer_ = true; | 676 added_transient_observer_ = true; |
682 ::wm::TransientWindowManager::Get(window_)->AddObserver(this); | 677 ::wm::TransientWindowManager::Get(window_)->AddObserver(this); |
683 } | 678 } |
684 transient_observers_.AddObserver(observer); | 679 transient_observers_.AddObserver(observer); |
685 } | 680 } |
686 | 681 |
687 void WmWindow::RemoveTransientWindowObserver( | 682 void WmWindow::RemoveTransientWindowObserver( |
688 WmTransientWindowObserver* observer) { | 683 WmTransientWindowObserver* observer) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 observer.OnTransientChildAdded(this, Get(transient)); | 733 observer.OnTransientChildAdded(this, Get(transient)); |
739 } | 734 } |
740 | 735 |
741 void WmWindow::OnTransientChildRemoved(aura::Window* window, | 736 void WmWindow::OnTransientChildRemoved(aura::Window* window, |
742 aura::Window* transient) { | 737 aura::Window* transient) { |
743 for (auto& observer : transient_observers_) | 738 for (auto& observer : transient_observers_) |
744 observer.OnTransientChildRemoved(this, Get(transient)); | 739 observer.OnTransientChildRemoved(this, Get(transient)); |
745 } | 740 } |
746 | 741 |
747 } // namespace ash | 742 } // namespace ash |
OLD | NEW |