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

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

Issue 2963013002: [TTS] Fix for tap on a previous tap-selection. (Closed)
Patch Set: Updated the CSInternalStateTest. Created 3 years, 6 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
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java
index c913693d0898f6f56beaa2554e582805ab10e28f..f8647601cf739c683d4b089916e75bf28f85ac13 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java
@@ -72,6 +72,11 @@ class ContextualSearchInternalStateController {
/** This starts a sequence of states needed to get to the SHOWING_TAP_SEARCH resting state.
*/
TAP_RECOGNIZED,
+ /** Waits to see if the Tap was on a previous tap-selection, which will show the selection
+ * manipulation pins and be subsumed by a LONG_PRESS_RECOGNIZED. If that doesn't happen
+ * within the waiting period we'll advance.
+ */
+ WAITING_FOR_POSSIBLE_TAP_ON_TAP_SELECTION,
/** Gathers text surrounding the selection. */
GATHERING_SURROUNDINGS,
/** Decides if the gesture should trigger the UX or be suppressed. */
@@ -233,6 +238,9 @@ class ContextualSearchInternalStateController {
break;
case TAP_RECOGNIZED:
break;
+ case WAITING_FOR_POSSIBLE_TAP_ON_TAP_SELECTION:
+ mStateHandler.waitForPossibleTapOnTapSelection();
+ break;
case GATHERING_SURROUNDINGS:
mStateHandler.gatherSurroundingText();
break;
@@ -293,13 +301,15 @@ class ContextualSearchInternalStateController {
reset(StateChangeReason.BASE_PAGE_TAP);
break;
case TAP_RECOGNIZED:
- if (mPreviousState == InternalState.SHOWING_TAP_SEARCH) {
- // This is a second-tap on a Tap-selection.
- // We'll soon recognize a Long-press and show the edit pins, so nothing needed.
+ if (mPreviousState != null && mPreviousState != InternalState.IDLE) {
+ transitionTo(InternalState.WAITING_FOR_POSSIBLE_TAP_ON_TAP_SELECTION);
} else {
transitionTo(InternalState.GATHERING_SURROUNDINGS);
}
break;
+ case WAITING_FOR_POSSIBLE_TAP_ON_TAP_SELECTION:
+ transitionTo(InternalState.GATHERING_SURROUNDINGS);
+ break;
case GATHERING_SURROUNDINGS:
// We gather surroundings for both Tap and Long-press in order to notify icing.
if (mPreviousState == InternalState.LONG_PRESS_RECOGNIZED) {
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698