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

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

Issue 2485693003: Drag-and-drop: DragEnter, DragOver, DragLeave, DragDrop (Closed)
Patch Set: No longer using GetSiteInstance() in RenderWidgetHostImpl. 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 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 host->FilterDropData(&filtered_data);
825 switch (drag_status) { 825 switch (drag_status) {
826 case blink::WebDragStatusEnter: 826 case blink::WebDragStatusEnter:
827 host->DragTargetDragEnter(filtered_data, location, location, mask, 827 host->GetWidget()->DragTargetDragEnter(filtered_data, location, location,
dcheng 2016/11/09 20:23:16 Is it worth adding a TODO here? Presumably we'll h
paulmeyer 2016/11/09 23:19:11 Done.
828 drop_data.key_modifiers); 828 mask, drop_data.key_modifiers);
829 // Only track the URL being dragged over the guest if the link isn't 829 // Only track the URL being dragged over the guest if the link isn't
830 // coming from the guest. 830 // coming from the guest.
831 if (!embedder->DragEnteredGuest(this)) 831 if (!embedder->DragEnteredGuest(this))
832 ignore_dragged_url_ = false; 832 ignore_dragged_url_ = false;
833 break; 833 break;
834 case blink::WebDragStatusOver: 834 case blink::WebDragStatusOver:
835 host->DragTargetDragOver(location, location, mask, 835 host->GetWidget()->DragTargetDragOver(location, location, mask,
836 drop_data.key_modifiers); 836 drop_data.key_modifiers);
837 break; 837 break;
838 case blink::WebDragStatusLeave: 838 case blink::WebDragStatusLeave:
839 embedder->DragLeftGuest(this); 839 embedder->DragLeftGuest(this);
840 host->DragTargetDragLeave(); 840 host->GetWidget()->DragTargetDragLeave();
841 ignore_dragged_url_ = true; 841 ignore_dragged_url_ = true;
842 break; 842 break;
843 case blink::WebDragStatusDrop: 843 case blink::WebDragStatusDrop:
844 host->DragTargetDrop(filtered_data, location, location, 844 host->GetWidget()->DragTargetDrop(filtered_data, location, location,
845 drop_data.key_modifiers); 845 drop_data.key_modifiers);
846 846
847 if (!ignore_dragged_url_ && filtered_data.url.is_valid()) 847 if (!ignore_dragged_url_ && filtered_data.url.is_valid())
848 delegate_->DidDropLink(filtered_data.url); 848 delegate_->DidDropLink(filtered_data.url);
849 ignore_dragged_url_ = true; 849 ignore_dragged_url_ = true;
850 break; 850 break;
851 case blink::WebDragStatusUnknown: 851 case blink::WebDragStatusUnknown:
852 ignore_dragged_url_ = true; 852 ignore_dragged_url_ = true;
853 NOTREACHED(); 853 NOTREACHED();
854 } 854 }
855 last_drag_status_ = drag_status; 855 last_drag_status_ = drag_status;
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 range, character_bounds); 1035 range, character_bounds);
1036 } 1036 }
1037 #endif 1037 #endif
1038 1038
1039 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) { 1039 void BrowserPluginGuest::SetContextMenuPosition(const gfx::Point& position) {
1040 if (delegate_) 1040 if (delegate_)
1041 delegate_->SetContextMenuPosition(position); 1041 delegate_->SetContextMenuPosition(position);
1042 } 1042 }
1043 1043
1044 } // namespace content 1044 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698