| 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/drag_controller.h" | 5 #include "services/ui/ws/drag_controller.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // It would be nice if we could just let the observer method fire, but it | 162 // It would be nice if we could just let the observer method fire, but it |
| 163 // fires during the constructor when we haven't assigned the unique_ptr | 163 // fires during the constructor when we haven't assigned the unique_ptr |
| 164 // yet. | 164 // yet. |
| 165 cursor_ = ui::mojom::CursorType(drag_operation_->current_cursor()); | 165 cursor_ = ui::mojom::CursorType(drag_operation_->current_cursor()); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void DispatchDrag(DragTestWindow* window, | 168 void DispatchDrag(DragTestWindow* window, |
| 169 bool mouse_released, | 169 bool mouse_released, |
| 170 uint32_t flags, | 170 uint32_t flags, |
| 171 const gfx::Point& position) { | 171 const gfx::Point& position) { |
| 172 ui::PointerEvent event( | 172 ui::PointerEvent event(ui::MouseEvent( |
| 173 ui::MouseEvent(mouse_released ? ET_MOUSE_RELEASED : ET_MOUSE_PRESSED, | 173 mouse_released ? ET_MOUSE_RELEASED : ET_MOUSE_PRESSED, position, |
| 174 position, position, ui::EventTimeForNow(), flags, 0)); | 174 position, ui::EventTimeForNow(), flags, 0, |
| 175 ui::PointerDetails(ui::EventPointerType::POINTER_TYPE_MOUSE))); |
| 175 drag_operation_->DispatchPointerEvent(event, | 176 drag_operation_->DispatchPointerEvent(event, |
| 176 window ? window->window() : nullptr); | 177 window ? window->window() : nullptr); |
| 177 } | 178 } |
| 178 | 179 |
| 179 void DispatchDragWithPointer(DragTestWindow* window, | 180 void DispatchDragWithPointer(DragTestWindow* window, |
| 180 int32_t drag_pointer, | 181 int32_t drag_pointer, |
| 181 bool mouse_released, | 182 bool mouse_released, |
| 182 uint32_t flags, | 183 uint32_t flags, |
| 183 const gfx::Point& position) { | 184 const gfx::Point& position) { |
| 184 ui::PointerEvent event( | 185 ui::PointerEvent event( |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 | 681 |
| 681 // Window 2 responding negatively to its queued messages shouldn't change the | 682 // Window 2 responding negatively to its queued messages shouldn't change the |
| 682 // cursor. | 683 // cursor. |
| 683 window2->Respond(false); | 684 window2->Respond(false); |
| 684 | 685 |
| 685 EXPECT_EQ(ui::mojom::CursorType::COPY, cursor()); | 686 EXPECT_EQ(ui::mojom::CursorType::COPY, cursor()); |
| 686 } | 687 } |
| 687 | 688 |
| 688 } // namespace ws | 689 } // namespace ws |
| 689 } // namespace ui | 690 } // namespace ui |
| OLD | NEW |