Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: components/test_runner/event_sender.cc

Issue 2501213002: Drag-and-drop: dragSourceEndedAt, dragSourceSystemDragEnded (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 9 #include <memory>
10 10
(...skipping 2680 matching lines...) Expand 10 before | Expand all | Expand 10 after
2691 current_drag_effect_ = drag_effect; 2691 current_drag_effect_ = drag_effect;
2692 if (current_drag_effect_) { 2692 if (current_drag_effect_) {
2693 // Specifically pass any keyboard modifiers to the drop method. This allows 2693 // Specifically pass any keyboard modifiers to the drop method. This allows
2694 // tests to control the drop type (i.e. copy or move). 2694 // tests to control the drop type (i.e. copy or move).
2695 mainFrameWidget()->dragTargetDrop(current_drag_data_, client_point, 2695 mainFrameWidget()->dragTargetDrop(current_drag_data_, client_point,
2696 screen_point, event->modifiers); 2696 screen_point, event->modifiers);
2697 } else { 2697 } else {
2698 mainFrameWidget()->dragTargetDragLeave(); 2698 mainFrameWidget()->dragTargetDragLeave();
2699 } 2699 }
2700 current_drag_data_.reset(); 2700 current_drag_data_.reset();
2701 view()->dragSourceEndedAt(client_point, screen_point, current_drag_effect_); 2701 mainFrameWidget()->dragSourceEndedAt(client_point, screen_point,
2702 view()->dragSourceSystemDragEnded(); 2702 current_drag_effect_);
2703 mainFrameWidget()->dragSourceSystemDragEnded();
2703 } 2704 }
2704 2705
2705 void EventSender::DoDragAfterMouseUp(const WebMouseEvent& raw_event) { 2706 void EventSender::DoDragAfterMouseUp(const WebMouseEvent& raw_event) {
2706 std::unique_ptr<WebInputEvent> widget_event = 2707 std::unique_ptr<WebInputEvent> widget_event =
2707 TransformScreenToWidgetCoordinates(raw_event); 2708 TransformScreenToWidgetCoordinates(raw_event);
2708 const WebMouseEvent* event = 2709 const WebMouseEvent* event =
2709 widget_event.get() ? static_cast<WebMouseEvent*>(widget_event.get()) 2710 widget_event.get() ? static_cast<WebMouseEvent*>(widget_event.get())
2710 : &raw_event; 2711 : &raw_event;
2711 2712
2712 last_click_time_sec_ = event->timeStampSeconds; 2713 last_click_time_sec_ = event->timeStampSeconds;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2901 return view()->mainFrame()->toWebLocalFrame()->frameWidget(); 2902 return view()->mainFrame()->toWebLocalFrame()->frameWidget();
2902 } 2903 }
2903 2904
2904 std::unique_ptr<WebInputEvent> EventSender::TransformScreenToWidgetCoordinates( 2905 std::unique_ptr<WebInputEvent> EventSender::TransformScreenToWidgetCoordinates(
2905 const WebInputEvent& event) { 2906 const WebInputEvent& event) {
2906 return delegate()->TransformScreenToWidgetCoordinates( 2907 return delegate()->TransformScreenToWidgetCoordinates(
2907 web_widget_test_proxy_base_, event); 2908 web_widget_test_proxy_base_, event);
2908 } 2909 }
2909 2910
2910 } // namespace test_runner 2911 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698