OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/ws/window_tree.h" | 5 #include "services/ui/ws/window_tree.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "mojo/public/cpp/bindings/map.h" | 14 #include "mojo/public/cpp/bindings/map.h" |
| 15 #include "services/ui/ws/cursor_location_manager.h" |
15 #include "services/ui/ws/default_access_policy.h" | 16 #include "services/ui/ws/default_access_policy.h" |
16 #include "services/ui/ws/display.h" | 17 #include "services/ui/ws/display.h" |
17 #include "services/ui/ws/display_manager.h" | 18 #include "services/ui/ws/display_manager.h" |
18 #include "services/ui/ws/event_matcher.h" | 19 #include "services/ui/ws/event_matcher.h" |
19 #include "services/ui/ws/focus_controller.h" | 20 #include "services/ui/ws/focus_controller.h" |
20 #include "services/ui/ws/operation.h" | 21 #include "services/ui/ws/operation.h" |
21 #include "services/ui/ws/platform_display.h" | 22 #include "services/ui/ws/platform_display.h" |
22 #include "services/ui/ws/server_window.h" | 23 #include "services/ui/ws/server_window.h" |
23 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h" | 24 #include "services/ui/ws/server_window_compositor_frame_sink_manager.h" |
24 #include "services/ui/ws/server_window_observer.h" | 25 #include "services/ui/ws/server_window_observer.h" |
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1722 window_manager_internal_client_binding_) { | 1723 window_manager_internal_client_binding_) { |
1723 return; | 1724 return; |
1724 } | 1725 } |
1725 window_manager_internal_client_binding_.reset( | 1726 window_manager_internal_client_binding_.reset( |
1726 new mojo::AssociatedBinding<mojom::WindowManagerClient>( | 1727 new mojo::AssociatedBinding<mojom::WindowManagerClient>( |
1727 this, std::move(internal))); | 1728 this, std::move(internal))); |
1728 } | 1729 } |
1729 | 1730 |
1730 void WindowTree::GetCursorLocationMemory( | 1731 void WindowTree::GetCursorLocationMemory( |
1731 const GetCursorLocationMemoryCallback& callback) { | 1732 const GetCursorLocationMemoryCallback& callback) { |
1732 callback.Run( | 1733 callback.Run(window_server_->display_manager() |
1733 window_server_->display_manager()->GetUserDisplayManager(user_id_)-> | 1734 ->GetCursorLocationManager(user_id_) |
1734 GetCursorLocationMemory()); | 1735 ->GetCursorLocationMemory()); |
1735 } | 1736 } |
1736 | 1737 |
1737 void WindowTree::PerformDragDrop( | 1738 void WindowTree::PerformDragDrop( |
1738 uint32_t change_id, | 1739 uint32_t change_id, |
1739 Id source_window_id, | 1740 Id source_window_id, |
1740 const std::unordered_map<std::string, std::vector<uint8_t>>& drag_data, | 1741 const std::unordered_map<std::string, std::vector<uint8_t>>& drag_data, |
1741 uint32_t drag_operation) { | 1742 uint32_t drag_operation) { |
1742 ServerWindow* window = GetWindowByClientId(ClientWindowId(source_window_id)); | 1743 ServerWindow* window = GetWindowByClientId(ClientWindowId(source_window_id)); |
1743 bool success = window && access_policy_->CanInitiateDragLoop(window); | 1744 bool success = window && access_policy_->CanInitiateDragLoop(window); |
1744 if (!success || !ShouldRouteToWindowManager(window)) { | 1745 if (!success || !ShouldRouteToWindowManager(window)) { |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, | 2156 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, |
2156 effect_bitmask, callback); | 2157 effect_bitmask, callback); |
2157 } | 2158 } |
2158 | 2159 |
2159 void WindowTree::PerformOnDragDropDone() { | 2160 void WindowTree::PerformOnDragDropDone() { |
2160 client()->OnDragDropDone(); | 2161 client()->OnDragDropDone(); |
2161 } | 2162 } |
2162 | 2163 |
2163 } // namespace ws | 2164 } // namespace ws |
2164 } // namespace ui | 2165 } // namespace ui |
OLD | NEW |