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

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

Issue 1242613002: [Android] Supporting floating select ActionModes for web content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java
index 15c6b771e842c091b9d94259b12d73329b56873a..a04f37da2bf971e96f08da3734aa89330ae4a8de 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewClient.java
@@ -7,9 +7,7 @@ package org.chromium.content.browser;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
-import android.view.ActionMode;
import android.view.KeyEvent;
-import android.view.View;
import android.view.View.MeasureSpec;
import org.chromium.base.Log;
@@ -86,27 +84,13 @@ public class ContentViewClient {
}
/**
- * Starts an ActionMode for in-page selection.
- * @param view The associated View.
- * @param actionHandler The associated ActionHandler.
- * @param floating Whether to try creating a floating ActionMode. If this
- * feature is unsupported, the return value will be null.
- * @return the SelectActionMode if creation is successful, otherwise null.
+ * Returns a WebActionModeCallback for in-page text selection.
+ * @param context the associated context.
+ * @param actionHandler the associated selection action handler.
*/
- public WebActionMode startActionMode(
- View view, ActionHandler actionHandler, boolean floating) {
- if (floating) return null;
- ActionMode.Callback callback =
- new WebActionModeCallback(view.getContext(), actionHandler);
- ActionMode actionMode = view.startActionMode(callback);
- return actionMode != null ? new WebActionMode(actionMode) : null;
- }
-
- /**
- * @return whether the client supports the creation of floating ActionMode instances.
- */
- public boolean supportsFloatingActionMode() {
- return false;
+ public WebActionModeCallback getWebActionModeCallback(
+ Context context, ActionHandler actionHandler) {
+ return new WebActionModeCallback(context, actionHandler);
}
/**

Powered by Google App Engine
This is Rietveld 408576698