| Index: android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| index a710d513896e2f65cc45be90c0a0c6231c552b5f..681844751cb0e2bca6e2de5af54947ad015857e9 100644
|
| --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
|
| @@ -6,6 +6,7 @@ package org.chromium.android_webview;
|
|
|
| import android.annotation.SuppressLint;
|
| import android.app.Activity;
|
| +import android.content.ClipDescription;
|
| import android.content.ComponentCallbacks2;
|
| import android.content.Context;
|
| import android.content.Intent;
|
| @@ -2974,8 +2975,30 @@ public class AwContents implements SmartClipProvider,
|
|
|
| @Override
|
| public boolean onDragEvent(DragEvent event) {
|
| - // TODO(hush): implement this. crbug.com/584789
|
| - return false;
|
| + switch (event.getAction()) {
|
| + case DragEvent.ACTION_DRAG_STARTED:
|
| + ClipDescription clipDescription = event.getClipDescription();
|
| + // TODO(hush): support dragging more than just text.
|
| + return clipDescription.hasMimeType(ClipDescription.MIMETYPE_TEXT_HTML)
|
| + || clipDescription.hasMimeType(clipDescription.MIMETYPE_TEXT_PLAIN);
|
| + case DragEvent.ACTION_DRAG_ENTERED:
|
| + mContentViewCore.onDragEntered(event);
|
| + return true;
|
| + case DragEvent.ACTION_DRAG_LOCATION:
|
| + mContentViewCore.onDragUpdated(event);
|
| + return true;
|
| + case DragEvent.ACTION_DROP:
|
| + // TODO(hush): onPerformDrop should return false when the receiving object does
|
| + // not accept the text drop.
|
| + mContentViewCore.onPerformDrop(event);
|
| + return true;
|
| + case DragEvent.ACTION_DRAG_EXITED:
|
| + mContentViewCore.onDragExited();
|
| + return true;
|
| + case DragEvent.ACTION_DRAG_ENDED:
|
| + default:
|
| + return true;
|
| + }
|
| }
|
|
|
| @Override
|
|
|