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

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

Issue 2655463015: Correctly set dragLeave and dragEnd coords for OOPIF drag and drop (Closed)
Patch Set: Added checks for null RWH on drag end Created 3 years, 10 months 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 2671 matching lines...) Expand 10 before | Expand all | Expand 10 after
2682 2682
2683 WebPoint client_point(event->x, event->y); 2683 WebPoint client_point(event->x, event->y);
2684 WebPoint screen_point(event->globalX, event->globalY); 2684 WebPoint screen_point(event->globalX, event->globalY);
2685 current_drag_effect_ = drag_effect; 2685 current_drag_effect_ = drag_effect;
2686 if (current_drag_effect_) { 2686 if (current_drag_effect_) {
2687 // Specifically pass any keyboard modifiers to the drop method. This allows 2687 // Specifically pass any keyboard modifiers to the drop method. This allows
2688 // tests to control the drop type (i.e. copy or move). 2688 // tests to control the drop type (i.e. copy or move).
2689 mainFrameWidget()->dragTargetDrop(current_drag_data_, client_point, 2689 mainFrameWidget()->dragTargetDrop(current_drag_data_, client_point,
2690 screen_point, event->modifiers()); 2690 screen_point, event->modifiers());
2691 } else { 2691 } else {
2692 mainFrameWidget()->dragTargetDragLeave(); 2692 mainFrameWidget()->dragTargetDragLeave(blink::WebPoint(),
2693 blink::WebPoint());
2693 } 2694 }
2694 current_drag_data_.reset(); 2695 current_drag_data_.reset();
2695 mainFrameWidget()->dragSourceEndedAt(client_point, screen_point, 2696 mainFrameWidget()->dragSourceEndedAt(client_point, screen_point,
2696 current_drag_effect_); 2697 current_drag_effect_);
2697 mainFrameWidget()->dragSourceSystemDragEnded(); 2698 mainFrameWidget()->dragSourceSystemDragEnded();
2698 } 2699 }
2699 2700
2700 void EventSender::DoDragAfterMouseUp(const WebMouseEvent& raw_event) { 2701 void EventSender::DoDragAfterMouseUp(const WebMouseEvent& raw_event) {
2701 std::unique_ptr<WebInputEvent> widget_event = 2702 std::unique_ptr<WebInputEvent> widget_event =
2702 TransformScreenToWidgetCoordinates(raw_event); 2703 TransformScreenToWidgetCoordinates(raw_event);
(...skipping 198 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
« no previous file with comments | « chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc ('k') | content/browser/browser_plugin/browser_plugin_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698