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 "components/test_runner/event_sender.h" | 5 #include "components/test_runner/event_sender.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 2576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2587 | 2587 |
2588 last_click_time_sec_ = e.timeStampSeconds; | 2588 last_click_time_sec_ = e.timeStampSeconds; |
2589 last_click_pos_ = last_mouse_pos_; | 2589 last_click_pos_ = last_mouse_pos_; |
2590 | 2590 |
2591 // If we're in a drag operation, complete it. | 2591 // If we're in a drag operation, complete it. |
2592 if (current_drag_data_.isNull()) | 2592 if (current_drag_data_.isNull()) |
2593 return; | 2593 return; |
2594 | 2594 |
2595 WebPoint client_point(e.x, e.y); | 2595 WebPoint client_point(e.x, e.y); |
2596 WebPoint screen_point(e.globalX, e.globalY); | 2596 WebPoint screen_point(e.globalX, e.globalY); |
2597 FinishDragAndDrop( | 2597 blink::WebDragOperation drag_effect = view_->dragTargetDragOver( |
2598 e, | 2598 client_point, |
2599 view_->dragTargetDragOver( | 2599 screen_point, |
2600 client_point, | 2600 current_drag_effects_allowed_, |
2601 screen_point, | 2601 e.modifiers); |
2602 current_drag_effects_allowed_, | 2602 |
2603 e.modifiers)); | 2603 // Bail if dragover caused cancellation. |
| 2604 if (current_drag_data_.isNull()) |
| 2605 return; |
| 2606 |
| 2607 FinishDragAndDrop(e, drag_effect); |
2604 } | 2608 } |
2605 | 2609 |
2606 void EventSender::DoMouseMove(const WebMouseEvent& e) { | 2610 void EventSender::DoMouseMove(const WebMouseEvent& e) { |
2607 last_mouse_pos_ = WebPoint(e.x, e.y); | 2611 last_mouse_pos_ = WebPoint(e.x, e.y); |
2608 | 2612 |
2609 HandleInputEventOnViewOrPopup(e); | 2613 HandleInputEventOnViewOrPopup(e); |
2610 | 2614 |
2611 if (pressed_button_ == WebMouseEvent::ButtonNone || | 2615 if (pressed_button_ == WebMouseEvent::ButtonNone || |
2612 current_drag_data_.isNull()) { | 2616 current_drag_data_.isNull()) { |
2613 return; | 2617 return; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2671 last_event_timestamp_ = event.timeStampSeconds; | 2675 last_event_timestamp_ = event.timeStampSeconds; |
2672 | 2676 |
2673 if (WebPagePopup* popup = view_->pagePopup()) { | 2677 if (WebPagePopup* popup = view_->pagePopup()) { |
2674 if (!WebInputEvent::isKeyboardEventType(event.type)) | 2678 if (!WebInputEvent::isKeyboardEventType(event.type)) |
2675 return popup->handleInputEvent(event); | 2679 return popup->handleInputEvent(event); |
2676 } | 2680 } |
2677 return view_->handleInputEvent(event); | 2681 return view_->handleInputEvent(event); |
2678 } | 2682 } |
2679 | 2683 |
2680 } // namespace test_runner | 2684 } // namespace test_runner |
OLD | NEW |