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

Unified Diff: content/browser/web_contents/web_contents_view_android.cc

Issue 1728193002: Support dragging texts into Android WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: generate DragEvent JNI bindings and use the enums from JNI Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_view_android.h ('k') | content/public/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0716d13d2fb2ae9053899b12397de5234c4c44ea..77d2c5fe24e08fd72cee7a6f44dbc2c078a62661 100644
--- a/content/browser/web_contents/web_contents_view_android.cc
+++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -13,8 +13,10 @@
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents_delegate.h"
+#include "content/public/common/drop_data.h"
namespace content {
+
WebContentsView* CreateWebContentsView(
WebContentsImpl* web_contents,
WebContentsViewDelegate* delegate,
@@ -199,6 +201,32 @@ void WebContentsViewAndroid::UpdateDragCursor(blink::WebDragOperation op) {
NOTIMPLEMENTED();
}
+void WebContentsViewAndroid::OnDragEntered(
+ const std::vector<DropData::Metadata>& metadata,
+ const gfx::Point& location,
+ const gfx::Point& screen_location) {
+ web_contents_->GetRenderViewHost()->DragTargetDragEnterWithMetaData(
+ metadata, location, screen_location, blink::WebDragOperationCopy, 0);
+}
+
+void WebContentsViewAndroid::OnDragUpdated(const gfx::Point& location,
+ const gfx::Point& screen_location) {
+ web_contents_->GetRenderViewHost()->DragTargetDragOver(
+ location, screen_location, blink::WebDragOperationCopy, 0);
+}
+
+void WebContentsViewAndroid::OnDragExited() {
+ web_contents_->GetRenderViewHost()->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);
+}
+
void WebContentsViewAndroid::GotFocus() {
// This is only used in the views FocusManager stuff but it bleeds through
// all subclasses. http://crbug.com/21875
« no previous file with comments | « content/browser/web_contents/web_contents_view_android.h ('k') | content/public/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698