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

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

Issue 23654021: Expose the ability to perform a search from CVC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved intent kickoff back to callback Created 7 years, 3 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/SelectActionModeCallback.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/SelectActionModeCallback.java b/content/public/android/java/src/org/chromium/content/browser/SelectActionModeCallback.java
index 6053448f554ae42d31589d8de0d570f0b82e01bd..24d953f544265fa99efb8c6c6c0b58b28f416653 100644
--- a/content/public/android/java/src/org/chromium/content/browser/SelectActionModeCallback.java
+++ b/content/public/android/java/src/org/chromium/content/browser/SelectActionModeCallback.java
@@ -76,6 +76,12 @@ public class SelectActionModeCallback implements ActionMode.Callback {
boolean paste();
/**
+ * Perform a search action.
+ * @return true iff the action was successful.
+ */
+ boolean search();
Ted C 2013/09/10 16:05:06 so this one is behaviorally different from the res
David Trainor- moved to gerrit 2013/09/10 22:35:46 I updated this to work as you'd expect. I removed
+
+ /**
* @return true iff the current selection is editable (e.g. text within an input field).
*/
boolean isSelectionEditable();
@@ -213,7 +219,7 @@ public class SelectActionModeCallback implements ActionMode.Callback {
mode.finish();
break;
case ID_SEARCH:
- if (!TextUtils.isEmpty(selection)) {
+ if (!TextUtils.isEmpty(selection) && !mActionHandler.search()) {
Intent i = new Intent(Intent.ACTION_WEB_SEARCH);
i.putExtra(SearchManager.EXTRA_NEW_SEARCH, true);
i.putExtra(SearchManager.QUERY, selection);

Powered by Google App Engine
This is Rietveld 408576698