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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 2485693003: Drag-and-drop: DragEnter, DragOver, DragLeave, DragDrop (Closed)
Patch Set: Rebased. More fixes. 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 } 814 }
815 815
816 void BrowserPluginGuest::OnDragStatusUpdate(int browser_plugin_instance_id, 816 void BrowserPluginGuest::OnDragStatusUpdate(int browser_plugin_instance_id,
817 blink::WebDragStatus drag_status, 817 blink::WebDragStatus drag_status,
818 const DropData& drop_data, 818 const DropData& drop_data,
819 blink::WebDragOperationsMask mask, 819 blink::WebDragOperationsMask mask,
820 const gfx::Point& location) { 820 const gfx::Point& location) {
821 RenderViewHost* host = GetWebContents()->GetRenderViewHost(); 821 RenderViewHost* host = GetWebContents()->GetRenderViewHost();
822 auto* embedder = owner_web_contents_->GetBrowserPluginEmbedder(); 822 auto* embedder = owner_web_contents_->GetBrowserPluginEmbedder();
823 DropData filtered_data(drop_data); 823 DropData filtered_data(drop_data);
824 host->FilterDropData(&filtered_data); 824 // TODO(paulmeyer): This will need to target the correct specific
825 // RenderWidgetHost to work with OOPIFs. See crbug.com/647249.
826 RenderWidgetHost* widget = host->GetWidget();
827 widget->FilterDropData(&filtered_data);
825 switch (drag_status) { 828 switch (drag_status) {
826 case blink::WebDragStatusEnter: 829 case blink::WebDragStatusEnter:
827 host->DragTargetDragEnter(filtered_data, location, location, mask, 830 widget->DragTargetDragEnter(filtered_data, location, location, mask,
828 drop_data.key_modifiers); 831 drop_data.key_modifiers);
829 // Only track the URL being dragged over the guest if the link isn't 832 // Only track the URL being dragged over the guest if the link isn't
830 // coming from the guest. 833 // coming from the guest.
831 if (!embedder->DragEnteredGuest(this)) 834 if (!embedder->DragEnteredGuest(this))
832 ignore_dragged_url_ = false; 835 ignore_dragged_url_ = false;
833 break; 836 break;
834 case blink::WebDragStatusOver: 837 case blink::WebDragStatusOver:
835 host->DragTargetDragOver(location, location, mask, 838 widget->DragTargetDragOver(location, location, mask,
836 drop_data.key_modifiers); 839 drop_data.key_modifiers);
837 break; 840 break;
838 case blink::WebDragStatusLeave: 841 case blink::WebDragStatusLeave:
839 embedder->DragLeftGuest(this); 842 embedder->DragLeftGuest(this);
840 host->DragTargetDragLeave(); 843 widget->DragTargetDragLeave();
841 ignore_dragged_url_ = true; 844 ignore_dragged_url_ = true;
842 break; 845 break;
843 case blink::WebDragStatusDrop: 846 case blink::WebDragStatusDrop:
844 host->DragTargetDrop(filtered_data, location, location, 847 widget->DragTargetDrop(filtered_data, location, location,
845 drop_data.key_modifiers); 848 drop_data.key_modifiers);
846 849
847 if (!ignore_dragged_url_ && filtered_data.url.is_valid()) 850 if (!ignore_dragged_url_ && filtered_data.url.is_valid())
848 delegate_->DidDropLink(filtered_data.url); 851 delegate_->DidDropLink(filtered_data.url);
849 ignore_dragged_url_ = true; 852 ignore_dragged_url_ = true;
850 break; 853 break;
851 case blink::WebDragStatusUnknown: 854 case blink::WebDragStatusUnknown:
852 ignore_dragged_url_ = true; 855 ignore_dragged_url_ = true;
853 NOTREACHED(); 856 NOTREACHED();
854 } 857 }
855 last_drag_status_ = drag_status; 858 last_drag_status_ = drag_status;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 range, character_bounds); 1038 range, character_bounds);
1036 } 1039 }
1037 #endif 1040 #endif
1038 1041
1039 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { 1042 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) {
1040 if (delegate_) 1043 if (delegate_)
1041 delegate_->SetContextMenuPosition(position); 1044 delegate_->SetContextMenuPosition(position);
1042 } 1045 }
1043 1046
1044 } // namespace content 1047 } // namespace content
OLDNEW
« no previous file with comments | « components/test_runner/event_sender.cc ('k') | content/browser/renderer_host/render_view_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698