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

Unified Diff: content/browser/web_contents/web_contents_view_android.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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_view_android.cc
diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc
index 338d07eb410e963b6fc9993c5aa4a1e1446f10f3..49a6e0209a6b42928f94483a2107691225264880 100644
--- a/content/browser/web_contents/web_contents_view_android.cc
+++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -304,6 +304,10 @@ void WebContentsViewAndroid::UpdateDragCursor(blink::WebDragOperation op) {
// Intentional no-op because Android does not have cursor.
}
+// TODO(paulmeyer): The drag-and-drop calls on GetRenderViewHost()->GetWidget()
+// in the following functions will need to be targeted to specific
+// RenderWidgetHosts in order to work with OOPIFs. See crbug.com/647249.
+
void WebContentsViewAndroid::OnDragEntered(
const std::vector<DropData::Metadata>& metadata,
const gfx::Point& location,
@@ -311,8 +315,9 @@ void WebContentsViewAndroid::OnDragEntered(
blink::WebDragOperationsMask allowed_ops =
static_cast<blink::WebDragOperationsMask>(blink::WebDragOperationCopy |
blink::WebDragOperationMove);
- web_contents_->GetRenderViewHost()->DragTargetDragEnterWithMetaData(
- metadata, location, screen_location, allowed_ops, 0);
+ web_contents_->GetRenderViewHost()->GetWidget()->
+ DragTargetDragEnterWithMetaData(metadata, location, screen_location,
+ allowed_ops, 0);
}
void WebContentsViewAndroid::OnDragUpdated(const gfx::Point& location,
@@ -320,20 +325,20 @@ void WebContentsViewAndroid::OnDragUpdated(const gfx::Point& location,
blink::WebDragOperationsMask allowed_ops =
static_cast<blink::WebDragOperationsMask>(blink::WebDragOperationCopy |
blink::WebDragOperationMove);
- web_contents_->GetRenderViewHost()->DragTargetDragOver(
+ web_contents_->GetRenderViewHost()->GetWidget()->DragTargetDragOver(
location, screen_location, allowed_ops, 0);
}
void WebContentsViewAndroid::OnDragExited() {
- web_contents_->GetRenderViewHost()->DragTargetDragLeave();
+ web_contents_->GetRenderViewHost()->GetWidget()->DragTargetDragLeave();
}
void WebContentsViewAndroid::OnPerformDrop(DropData* drop_data,
const gfx::Point& location,
const gfx::Point& screen_location) {
- web_contents_->GetRenderViewHost()->FilterDropData(drop_data);
- web_contents_->GetRenderViewHost()->DragTargetDrop(*drop_data, location,
- screen_location, 0);
+ web_contents_->GetRenderViewHost()->GetWidget()->FilterDropData(drop_data);
+ web_contents_->GetRenderViewHost()->GetWidget()->DragTargetDrop(
+ *drop_data, location, screen_location, 0);
}
void WebContentsViewAndroid::OnDragEnded() {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | content/browser/web_contents/web_contents_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698