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 "services/ui/ws/window_manager_state.h" | 5 #include "services/ui/ws/window_manager_state.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 void WindowManagerState::ReleaseCaptureBlockedByModalWindow( | 186 void WindowManagerState::ReleaseCaptureBlockedByModalWindow( |
187 const ServerWindow* modal_window) { | 187 const ServerWindow* modal_window) { |
188 event_dispatcher_.ReleaseCaptureBlockedByModalWindow(modal_window); | 188 event_dispatcher_.ReleaseCaptureBlockedByModalWindow(modal_window); |
189 } | 189 } |
190 | 190 |
191 void WindowManagerState::ReleaseCaptureBlockedByAnyModalWindow() { | 191 void WindowManagerState::ReleaseCaptureBlockedByAnyModalWindow() { |
192 event_dispatcher_.ReleaseCaptureBlockedByAnyModalWindow(); | 192 event_dispatcher_.ReleaseCaptureBlockedByAnyModalWindow(); |
193 } | 193 } |
194 | 194 |
| 195 void WindowManagerState::SetCursorLocation(const gfx::Point& display_pixels, |
| 196 int64_t display_id) { |
| 197 Display* display = display_manager()->GetDisplayById(display_id); |
| 198 if (!display) { |
| 199 NOTIMPLEMENTED() << "Window manager sent invalid display_id!"; |
| 200 return; |
| 201 } |
| 202 |
| 203 event_dispatcher()->SetMousePointerDisplayLocation(display_pixels, |
| 204 display_id); |
| 205 UpdateNativeCursorFromDispatcher(); |
| 206 display->platform_display()->MoveCursorTo(display_pixels); |
| 207 } |
| 208 |
195 void WindowManagerState::SetDragDropSourceWindow( | 209 void WindowManagerState::SetDragDropSourceWindow( |
196 DragSource* drag_source, | 210 DragSource* drag_source, |
197 ServerWindow* window, | 211 ServerWindow* window, |
198 DragTargetConnection* source_connection, | 212 DragTargetConnection* source_connection, |
199 const std::unordered_map<std::string, std::vector<uint8_t>>& drag_data, | 213 const std::unordered_map<std::string, std::vector<uint8_t>>& drag_data, |
200 uint32_t drag_operation) { | 214 uint32_t drag_operation) { |
201 int32_t drag_pointer = MouseEvent::kMousePointerId; | 215 int32_t drag_pointer = MouseEvent::kMousePointerId; |
202 if (in_flight_event_details_ && | 216 if (in_flight_event_details_ && |
203 in_flight_event_details_->event->IsPointerEvent()) { | 217 in_flight_event_details_->event->IsPointerEvent()) { |
204 drag_pointer = | 218 drag_pointer = |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 window->RemoveObserver(this); | 774 window->RemoveObserver(this); |
761 orphaned_window_manager_display_roots_.erase(iter); | 775 orphaned_window_manager_display_roots_.erase(iter); |
762 return; | 776 return; |
763 } | 777 } |
764 } | 778 } |
765 NOTREACHED(); | 779 NOTREACHED(); |
766 } | 780 } |
767 | 781 |
768 } // namespace ws | 782 } // namespace ws |
769 } // namespace ui | 783 } // namespace ui |
OLD | NEW |