Chromium Code Reviews| 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" |
| 11 #include "ash/common/wm_window_property.h" | 11 #include "ash/common/wm_window_property.h" |
| 12 #include "ash/mus/bridge/mus_layout_manager_adapter.h" | 12 #include "ash/mus/bridge/mus_layout_manager_adapter.h" |
| 13 #include "ash/mus/bridge/wm_root_window_controller_mus.h" | 13 #include "ash/mus/bridge/wm_root_window_controller_mus.h" |
| 14 #include "ash/mus/bridge/wm_shell_mus.h" | 14 #include "ash/mus/bridge/wm_shell_mus.h" |
| 15 #include "ash/mus/property_util.h" | 15 #include "ash/mus/property_util.h" |
| 16 #include "services/ui/public/cpp/property_type_converters.h" | 16 #include "services/ui/public/cpp/property_type_converters.h" |
| 17 #include "services/ui/public/cpp/window.h" | 17 #include "services/ui/public/cpp/window.h" |
| 18 #include "services/ui/public/cpp/window_property.h" | 18 #include "services/ui/public/cpp/window_property.h" |
| 19 #include "services/ui/public/cpp/window_tree_client.h" | 19 #include "services/ui/public/cpp/window_tree_client.h" |
| 20 #include "services/ui/public/interfaces/window_manager.mojom.h" | 20 #include "services/ui/public/interfaces/window_manager.mojom.h" |
| 21 #include "ui/aura/mus/mus_util.h" | 21 #include "ui/aura/mus/mus_util.h" |
| 22 #include "ui/aura/window.h" | |
| 22 #include "ui/base/hit_test.h" | 23 #include "ui/base/hit_test.h" |
| 23 #include "ui/display/display.h" | 24 #include "ui/display/display.h" |
| 24 #include "ui/views/view.h" | 25 #include "ui/views/view.h" |
| 25 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
| 26 #include "ui/views/widget/widget_delegate.h" | 27 #include "ui/views/widget/widget_delegate.h" |
| 27 | 28 |
| 28 MUS_DECLARE_WINDOW_PROPERTY_TYPE(ash::mus::WmWindowMus*); | 29 MUS_DECLARE_WINDOW_PROPERTY_TYPE(ash::mus::WmWindowMus*); |
| 29 | 30 |
| 30 // TODO(sky): fully implement this. Making DVLOG as too spammy to be useful. | 31 // TODO(sky): fully implement this. Making DVLOG as too spammy to be useful. |
| 31 #undef NOTIMPLEMENTED | 32 #undef NOTIMPLEMENTED |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 732 } | 733 } |
| 733 | 734 |
| 734 void WmWindowMus::RemoveObserver(WmWindowObserver* observer) { | 735 void WmWindowMus::RemoveObserver(WmWindowObserver* observer) { |
| 735 observers_.RemoveObserver(observer); | 736 observers_.RemoveObserver(observer); |
| 736 } | 737 } |
| 737 | 738 |
| 738 bool WmWindowMus::HasObserver(const WmWindowObserver* observer) const { | 739 bool WmWindowMus::HasObserver(const WmWindowObserver* observer) const { |
| 739 return observers_.HasObserver(observer); | 740 return observers_.HasObserver(observer); |
| 740 } | 741 } |
| 741 | 742 |
| 743 void WmWindowMus::AddLimitedPreTargetHandler(ui::EventHandler* handler) { | |
| 744 widget_->GetNativeWindow()->AddPreTargetHandler(handler); | |
|
msw
2016/07/25 22:56:44
q: Should this use GetInternalWidget (and bail if
sky
2016/07/26 13:25:20
It's possible to make the non-internal widget case
msw
2016/07/26 17:43:25
Done.
| |
| 745 } | |
| 746 | |
| 747 void WmWindowMus::RemoveLimitedPreTargetHandler(ui::EventHandler* handler) { | |
| 748 widget_->GetNativeWindow()->RemovePreTargetHandler(handler); | |
| 749 } | |
| 750 | |
| 742 void WmWindowMus::OnTreeChanging(const TreeChangeParams& params) { | 751 void WmWindowMus::OnTreeChanging(const TreeChangeParams& params) { |
| 743 WmWindowObserver::TreeChangeParams wm_params; | 752 WmWindowObserver::TreeChangeParams wm_params; |
| 744 wm_params.target = Get(params.target); | 753 wm_params.target = Get(params.target); |
| 745 wm_params.new_parent = Get(params.new_parent); | 754 wm_params.new_parent = Get(params.new_parent); |
| 746 wm_params.old_parent = Get(params.old_parent); | 755 wm_params.old_parent = Get(params.old_parent); |
| 747 FOR_EACH_OBSERVER(WmWindowObserver, observers_, | 756 FOR_EACH_OBSERVER(WmWindowObserver, observers_, |
| 748 OnWindowTreeChanging(this, wm_params)); | 757 OnWindowTreeChanging(this, wm_params)); |
| 749 } | 758 } |
| 750 | 759 |
| 751 void WmWindowMus::OnTreeChanged(const TreeChangeParams& params) { | 760 void WmWindowMus::OnTreeChanged(const TreeChangeParams& params) { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 794 void WmWindowMus::OnWindowDestroying(::ui::Window* window) { | 803 void WmWindowMus::OnWindowDestroying(::ui::Window* window) { |
| 795 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); | 804 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroying(this)); |
| 796 } | 805 } |
| 797 | 806 |
| 798 void WmWindowMus::OnWindowDestroyed(::ui::Window* window) { | 807 void WmWindowMus::OnWindowDestroyed(::ui::Window* window) { |
| 799 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroyed(this)); | 808 FOR_EACH_OBSERVER(WmWindowObserver, observers_, OnWindowDestroyed(this)); |
| 800 } | 809 } |
| 801 | 810 |
| 802 } // namespace mus | 811 } // namespace mus |
| 803 } // namespace ash | 812 } // namespace ash |
| OLD | NEW |