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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 2133303002: Gate Android drag and drop feature with a flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Less JNI calls Created 4 years, 5 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/android/content_view_core_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 0fe099be46b029169421f679ccf2652d0543907b..a1c24280c5b732b2a1b95590c535631f9fb6ad3a 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -3285,6 +3285,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
public boolean onDragEvent(DragEvent event) {
if (mNativeContentViewCore == 0) return false;
+
ClipDescription clipDescription = event.getClipDescription();
if (clipDescription == null && event.getAction() != DragEvent.ACTION_DRAG_ENDED) {
Log.e(TAG, "Null clipDescription when the drag is not ended.");
@@ -3297,7 +3298,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
if (event.getAction() == DragEvent.ACTION_DRAG_STARTED) {
// TODO(hush): support dragging more than just text.
- return mimeTypes.length > 0;
+ return mimeTypes.length > 0 && nativeIsTouchDragDropEnabled(mNativeContentViewCore);
}
StringBuilder content = new StringBuilder("");
@@ -3568,6 +3569,7 @@ public class ContentViewCore implements AccessibilityStateChangeListener, Screen
int x, int y, int w, int h);
private native void nativeSetBackgroundOpaque(long nativeContentViewCoreImpl, boolean opaque);
+ private native boolean nativeIsTouchDragDropEnabled(long nativeContentViewCoreImpl);
private native void nativeOnDragEvent(long nativeContentViewCoreImpl, int action, int x, int y,
int screenX, int screenY, String[] mimeTypes, String content);
}
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698