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

Unified Diff: android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java

Issue 1066053002: [Android] Allow custom ActionMode creation via ContentViewClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix null check Created 5 years, 8 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 | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java
index 6fb65e91ca97006181b298ccda1c5afe2a45b79c..5bae06810c4f105d3a641f7efe183705b24abda1 100644
--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java
+++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java
@@ -16,6 +16,7 @@ import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
+import android.view.ActionMode;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.ClientCertRequest;
@@ -50,6 +51,9 @@ import org.chromium.base.annotations.SuppressFBWarnings;
import org.chromium.content.browser.ContentView;
import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
+import org.chromium.content.browser.SelectActionMode;
+import org.chromium.content.browser.SelectActionModeCallback;
+import org.chromium.content.browser.SelectActionModeCallback.ActionHandler;
import java.lang.ref.WeakReference;
import java.security.Principal;
@@ -379,6 +383,33 @@ public class WebViewContentsClientAdapter extends AwContentsClient {
}
}
+ /**
+ * @See AwContentsClient#startActionMode(View,ActionHandler,boolean)
+ */
+ @Override
+ public SelectActionMode startActionMode(
+ View view, ActionHandler actionHandler, boolean floating) {
+ try {
+ TraceEvent.begin("WebViewContentsClientAdapter.startActionMode");
+ if (TRACE) Log.d(TAG, "startActionMode");
+ if (floating) return null;
+ ActionMode.Callback callback =
+ new SelectActionModeCallback(view.getContext(), actionHandler);
+ ActionMode actionMode = view.startActionMode(callback);
+ return actionMode != null ? new SelectActionMode(actionMode) : null;
+ } finally {
+ TraceEvent.end("WebViewContentsClientAdapter.startActionMode");
+ }
+ }
+
+ /**
+ * @See AwContentsClient#supportsFloatingActionMode()
+ */
+ @Override
+ public boolean supportsFloatingActionMode() {
+ return false;
+ }
+
@Override
public void onLoadResource(String url) {
try {
« no previous file with comments | « no previous file | android_webview/java/src/org/chromium/android_webview/AwContentViewClient.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698