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

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

Issue 2785853002: Selection Action mode triggered like a context menu (Closed)
Patch Set: Fixing rebase bug Created 3 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
Index: content/public/android/java/src/org/chromium/content/browser/ContextSelectionClient.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContextSelectionClient.java b/content/public/android/java/src/org/chromium/content/browser/ContextSelectionClient.java
index 6a8bcea1be127d6450024cd13c9400a3b5a49a39..0edd3f5938fa1774bb327b06085d747954b786c1 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContextSelectionClient.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContextSelectionClient.java
@@ -79,24 +79,11 @@ public class ContextSelectionClient implements SelectionClient {
@Override
public void onSelectionEvent(int eventType, float posXPix, float posYPix) {
switch (eventType) {
- case SelectionEventType.SELECTION_HANDLES_SHOWN:
- // This event is sent when the long press is detected which causes
- // selection to appear for the first time. Temporarily hiding the
- // handles that happens e.g. during scroll does not affect this event.
- requestSurroundingText(SUGGEST_AND_CLASSIFY);
- break;
-
case SelectionEventType.SELECTION_HANDLES_CLEARED:
// The ActionMode should be stopped when this event comes.
cancelAllRequests();
break;
- case SelectionEventType.SELECTION_HANDLE_DRAG_STOPPED:
- // This event is sent after a user stopped dragging one of the
- // selection handles, i.e. stopped modifying the selection.
- requestSurroundingText(CLASSIFY);
- break;
-
default:
break; // ignore
}
@@ -106,7 +93,8 @@ public class ContextSelectionClient implements SelectionClient {
public void showUnhandledTapUIIfNeeded(int x, int y) {}
@Override
- public boolean sendsSelectionPopupUpdates() {
+ public boolean sendsSelectionPopupUpdates(boolean shouldSuggest) {
+ requestSurroundingText(shouldSuggest ? SUGGEST_AND_CLASSIFY : CLASSIFY);
boliu 2017/04/21 21:20:18 this method right now is "does this client send se
return true;
}

Powered by Google App Engine
This is Rietveld 408576698