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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java

Issue 1239583003: Update touch selection notification names, add ESTABLISHED. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add new SelectionEventTypes for bounds changing instead of reusing an insertion event. Created 5 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
Index: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java
index 176227acfa148a17b9dd473d5a8373e3d87ef43d..1e1fe9638f21cfe5319934124012d8fafe7540c8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java
@@ -54,6 +54,7 @@ public class ContextualSearchSelectionController {
private boolean mIsSelectionBeingModified;
private boolean mWasLastTapValid;
private boolean mIsWaitingForInvalidTapDetection;
+ private boolean mIsSelectionBoundsDissolved;
private boolean mShouldHandleSelectionModification;
private boolean mDidExpandSelection;
@@ -177,6 +178,7 @@ public class ContextualSearchSelectionController {
handleSelection(selection, mSelectionType);
mWasTapGestureDetected = false;
}
+ mIsSelectionBoundsDissolved = false;
}
/**
@@ -204,6 +206,9 @@ public class ContextualSearchSelectionController {
mIsSelectionBeingModified = false;
shouldHandleSelection = mShouldHandleSelectionModification;
break;
+ case SelectionEventType.BOUNDS_DISSOLVED:
+ mIsSelectionBoundsDissolved = true;
jdduke (slow) 2015/07/15 23:08:51 Shouldn't you reset this when there's a new select
+ break;
default:
}
@@ -232,7 +237,6 @@ public class ContextualSearchSelectionController {
mHandler.handleSelection(selection, isValidSelection(selection), type, mX, mY);
}
-
/**
* Resets all internal state of this class, including the tap state.
*/
@@ -363,6 +367,14 @@ public class ContextualSearchSelectionController {
return mIsWaitingForInvalidTapDetection;
}
+ /**
+ * @return whether an insertion point is currently shown, for testing.
+ */
+ @VisibleForTesting
+ boolean isSelectionBoundsDissolved() {
+ return mIsSelectionBoundsDissolved;
+ }
+
/** Determines if the given selection is valid or not.
* @param selection The selection portion of the context.
* @return whether the given selection is considered a valid target for a search.

Powered by Google App Engine
This is Rietveld 408576698