| 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 "ui/views/mus/desktop_window_tree_host_mus.h" | 5 #include "ui/views/mus/desktop_window_tree_host_mus.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "ui/aura/client/aura_constants.h" | 11 #include "ui/aura/client/aura_constants.h" |
| 12 #include "ui/aura/client/capture_client.h" | 12 #include "ui/aura/client/capture_client.h" |
| 13 #include "ui/aura/client/cursor_client.h" | 13 #include "ui/aura/client/cursor_client.h" |
| 14 #include "ui/aura/client/drag_drop_client.h" | 14 #include "ui/aura/client/drag_drop_client.h" |
| 15 #include "ui/aura/client/focus_client.h" | 15 #include "ui/aura/client/focus_client.h" |
| 16 #include "ui/aura/client/transient_window_client.h" | 16 #include "ui/aura/client/transient_window_client.h" |
| 17 #include "ui/aura/mus/focus_synchronizer.h" | 17 #include "ui/aura/mus/focus_synchronizer.h" |
| 18 #include "ui/aura/mus/window_port_mus.h" | 18 #include "ui/aura/mus/window_port_mus.h" |
| 19 #include "ui/aura/mus/window_tree_client.h" | 19 #include "ui/aura/mus/window_tree_client.h" |
| 20 #include "ui/aura/mus/window_tree_host_mus.h" | 20 #include "ui/aura/mus/window_tree_host_mus.h" |
| 21 #include "ui/aura/mus/window_tree_host_mus_init_params.h" |
| 21 #include "ui/aura/window.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/screen.h" | 24 #include "ui/display/screen.h" |
| 24 #include "ui/gfx/geometry/dip_util.h" | 25 #include "ui/gfx/geometry/dip_util.h" |
| 25 #include "ui/views/corewm/tooltip_aura.h" | 26 #include "ui/views/corewm/tooltip_aura.h" |
| 26 #include "ui/views/mus/mus_client.h" | 27 #include "ui/views/mus/mus_client.h" |
| 27 #include "ui/views/mus/mus_property_mirror.h" | 28 #include "ui/views/mus/mus_property_mirror.h" |
| 28 #include "ui/views/mus/window_manager_frame_values.h" | 29 #include "ui/views/mus/window_manager_frame_values.h" |
| 29 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 30 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
| 30 #include "ui/views/widget/native_widget_aura.h" | 31 #include "ui/views/widget/native_widget_aura.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 void OnMoveLoopEnd(bool* out_success, | 178 void OnMoveLoopEnd(bool* out_success, |
| 178 base::Closure quit_closure, | 179 base::Closure quit_closure, |
| 179 bool in_success) { | 180 bool in_success) { |
| 180 *out_success = in_success; | 181 *out_success = in_success; |
| 181 quit_closure.Run(); | 182 quit_closure.Run(); |
| 182 } | 183 } |
| 183 | 184 |
| 184 } // namespace | 185 } // namespace |
| 185 | 186 |
| 186 DesktopWindowTreeHostMus::DesktopWindowTreeHostMus( | 187 DesktopWindowTreeHostMus::DesktopWindowTreeHostMus( |
| 188 std::unique_ptr<aura::WindowTreeHostMusInitParams> init_params, |
| 187 internal::NativeWidgetDelegate* native_widget_delegate, | 189 internal::NativeWidgetDelegate* native_widget_delegate, |
| 188 DesktopNativeWidgetAura* desktop_native_widget_aura, | 190 DesktopNativeWidgetAura* desktop_native_widget_aura) |
| 189 const cc::FrameSinkId& frame_sink_id, | 191 : aura::WindowTreeHostMus(std::move(init_params)), |
| 190 const std::map<std::string, std::vector<uint8_t>>* mus_properties) | |
| 191 : aura::WindowTreeHostMus(MusClient::Get()->window_tree_client(), | |
| 192 frame_sink_id, | |
| 193 mus_properties), | |
| 194 native_widget_delegate_(native_widget_delegate), | 192 native_widget_delegate_(native_widget_delegate), |
| 195 desktop_native_widget_aura_(desktop_native_widget_aura), | 193 desktop_native_widget_aura_(desktop_native_widget_aura), |
| 196 close_widget_factory_(this) { | 194 close_widget_factory_(this) { |
| 197 MusClient::Get()->AddObserver(this); | 195 MusClient::Get()->AddObserver(this); |
| 198 MusClient::Get()->window_tree_client()->focus_synchronizer()->AddObserver( | 196 MusClient::Get()->window_tree_client()->focus_synchronizer()->AddObserver( |
| 199 this); | 197 this); |
| 200 native_widget_delegate_->AsWidget()->AddObserver(this); | 198 native_widget_delegate_->AsWidget()->AddObserver(this); |
| 201 desktop_native_widget_aura_->content_window()->AddObserver(this); | 199 desktop_native_widget_aura_->content_window()->AddObserver(this); |
| 202 // DesktopNativeWidgetAura registers the association between |content_window_| | 200 // DesktopNativeWidgetAura registers the association between |content_window_| |
| 203 // and Widget, but code may also want to go from the root (window()) to the | 201 // and Widget, but code may also want to go from the root (window()) to the |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 } | 796 } |
| 799 const gfx::Rect old_bounds_in_pixels = GetBoundsInPixels(); | 797 const gfx::Rect old_bounds_in_pixels = GetBoundsInPixels(); |
| 800 WindowTreeHostMus::SetBoundsInPixels(final_bounds_in_pixels); | 798 WindowTreeHostMus::SetBoundsInPixels(final_bounds_in_pixels); |
| 801 if (old_bounds_in_pixels.size() != final_bounds_in_pixels.size()) { | 799 if (old_bounds_in_pixels.size() != final_bounds_in_pixels.size()) { |
| 802 SendClientAreaToServer(); | 800 SendClientAreaToServer(); |
| 803 SendHitTestMaskToServer(); | 801 SendHitTestMaskToServer(); |
| 804 } | 802 } |
| 805 } | 803 } |
| 806 | 804 |
| 807 } // namespace views | 805 } // namespace views |
| OLD | NEW |