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. |