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

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

Issue 2501213002: Drag-and-drop: dragSourceEndedAt, dragSourceSystemDragEnded (Closed)
Patch Set: Rebased. Added check for !GetWebWidget(). 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 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after
2692 current_drag_effect_ = drag_effect; 2692 current_drag_effect_ = drag_effect;
2693 if (current_drag_effect_) { 2693 if (current_drag_effect_) {
2694 // Specifically pass any keyboard modifiers to the drop method. This allows 2694 // Specifically pass any keyboard modifiers to the drop method. This allows
2695 // tests to control the drop type (i.e. copy or move). 2695 // tests to control the drop type (i.e. copy or move).
2696 mainFrameWidget()->dragTargetDrop(current_drag_data_, client_point, 2696 mainFrameWidget()->dragTargetDrop(current_drag_data_, client_point,
2697 screen_point, event->modifiers); 2697 screen_point, event->modifiers);
2698 } else { 2698 } else {
2699 mainFrameWidget()->dragTargetDragLeave(); 2699 mainFrameWidget()->dragTargetDragLeave();
2700 } 2700 }
2701 current_drag_data_.reset(); 2701 current_drag_data_.reset();
2702 view()->dragSourceEndedAt(client_point, screen_point, current_drag_effect_); 2702 mainFrameWidget()->dragSourceEndedAt(client_point, screen_point,
2703 view()->dragSourceSystemDragEnded(); 2703 current_drag_effect_);
2704 mainFrameWidget()->dragSourceSystemDragEnded();
2704 } 2705 }
2705 2706
2706 void EventSender::DoDragAfterMouseUp(const WebMouseEvent& raw_event) { 2707 void EventSender::DoDragAfterMouseUp(const WebMouseEvent& raw_event) {
2707 std::unique_ptr<WebInputEvent> widget_event = 2708 std::unique_ptr<WebInputEvent> widget_event =
2708 TransformScreenToWidgetCoordinates(raw_event); 2709 TransformScreenToWidgetCoordinates(raw_event);
2709 const WebMouseEvent* event = 2710 const WebMouseEvent* event =
2710 widget_event.get() ? static_cast<WebMouseEvent*>(widget_event.get()) 2711 widget_event.get() ? static_cast<WebMouseEvent*>(widget_event.get())
2711 : &raw_event; 2712 : &raw_event;
2712 2713
2713 last_click_time_sec_ = event->timeStampSeconds; 2714 last_click_time_sec_ = event->timeStampSeconds;
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2902 return view()->mainFrame()->toWebLocalFrame()->frameWidget(); 2903 return view()->mainFrame()->toWebLocalFrame()->frameWidget();
2903 } 2904 }
2904 2905
2905 std::unique_ptr<WebInputEvent> EventSender::TransformScreenToWidgetCoordinates( 2906 std::unique_ptr<WebInputEvent> EventSender::TransformScreenToWidgetCoordinates(
2906 const WebInputEvent& event) { 2907 const WebInputEvent& event) {
2907 return delegate()->TransformScreenToWidgetCoordinates( 2908 return delegate()->TransformScreenToWidgetCoordinates(
2908 web_widget_test_proxy_base_, event); 2909 web_widget_test_proxy_base_, event);
2909 } 2910 }
2910 2911
2911 } // namespace test_runner 2912 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698