| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/event_dispatcher.h" | 5 #include "services/ui/ws/event_dispatcher.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "services/ui/ws/accelerator.h" | 10 #include "services/ui/ws/accelerator.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 DragTargetConnection* source_connection, | 169 DragTargetConnection* source_connection, |
| 170 int32_t drag_pointer, | 170 int32_t drag_pointer, |
| 171 mojo::Map<mojo::String, mojo::Array<uint8_t>> mime_data, | 171 mojo::Map<mojo::String, mojo::Array<uint8_t>> mime_data, |
| 172 uint32_t drag_operations) { | 172 uint32_t drag_operations) { |
| 173 CancelImplicitCaptureExcept(nullptr); | 173 CancelImplicitCaptureExcept(nullptr); |
| 174 drag_controller_ = base::MakeUnique<DragController>( | 174 drag_controller_ = base::MakeUnique<DragController>( |
| 175 drag_source, window, source_connection, drag_pointer, | 175 drag_source, window, source_connection, drag_pointer, |
| 176 std::move(mime_data), drag_operations); | 176 std::move(mime_data), drag_operations); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void EventDispatcher::CancelDragDrop() { |
| 180 if (drag_controller_) |
| 181 drag_controller_->Cancel(); |
| 182 } |
| 183 |
| 179 void EventDispatcher::EndDragDrop() { | 184 void EventDispatcher::EndDragDrop() { |
| 180 drag_controller_.reset(); | 185 drag_controller_.reset(); |
| 181 } | 186 } |
| 182 | 187 |
| 183 void EventDispatcher::OnWillDestroyDragTargetConnection( | 188 void EventDispatcher::OnWillDestroyDragTargetConnection( |
| 184 DragTargetConnection* connection) { | 189 DragTargetConnection* connection) { |
| 185 if (drag_controller_) | 190 if (drag_controller_) |
| 186 drag_controller_->OnWillDestroyDragTargetConnection(connection); | 191 drag_controller_->OnWillDestroyDragTargetConnection(connection); |
| 187 } | 192 } |
| 188 | 193 |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 | 607 |
| 603 void EventDispatcher::OnWindowDestroyed(ServerWindow* window) { | 608 void EventDispatcher::OnWindowDestroyed(ServerWindow* window) { |
| 604 CancelPointerEventsToTarget(window); | 609 CancelPointerEventsToTarget(window); |
| 605 | 610 |
| 606 if (mouse_cursor_source_window_ == window) | 611 if (mouse_cursor_source_window_ == window) |
| 607 mouse_cursor_source_window_ = nullptr; | 612 mouse_cursor_source_window_ = nullptr; |
| 608 } | 613 } |
| 609 | 614 |
| 610 } // namespace ws | 615 } // namespace ws |
| 611 } // namespace ui | 616 } // namespace ui |
| OLD | NEW |