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

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

Issue 2906763002: [TTS] Add some initial signals for Tap in content. (Closed)
Patch Set: Just fix an off-by-one bug on an index bounds found by a failing test. Created 3 years, 7 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 9f296ceef16e9c55c63621923cdd967c8df31324..edae5444f0abbf27738f4d62fb3aa5a66e8e7680 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
@@ -205,7 +205,7 @@ public class ContextualSearchSelectionController {
if (baseContentView != null) {
baseContentView.clearSelection();
}
- resetAllStates();
+ resetSelectionStates();
}
/**
@@ -351,10 +351,12 @@ public class ContextualSearchSelectionController {
* or #handleNonSuppressedTap() after a possible delay.
* This should be called when the context is fully built (by gathering surrounding text
* if needed, etc) but before showing any UX.
+ * @param contextualSearchContext The {@link ContextualSearchContext} for the Tap gesture.
* @param rankerLogger The {@link ContextualSearchRankerLogger} currently being used to measure
* or suppress the UI by Ranker.
*/
- void handleShouldSuppressTap(ContextualSearchRankerLogger rankerLogger) {
+ void handleShouldSuppressTap(ContextualSearchContext contextualSearchContext,
+ ContextualSearchRankerLogger rankerLogger) {
int x = (int) mX;
int y = (int) mY;
@@ -362,9 +364,8 @@ public class ContextualSearchSelectionController {
ChromePreferenceManager prefs = ChromePreferenceManager.getInstance();
int adjustedTapsSinceOpen = prefs.getContextualSearchTapCount()
- prefs.getContextualSearchTapQuickAnswerCount();
- TapSuppressionHeuristics tapHeuristics =
- new TapSuppressionHeuristics(this, mLastTapState, x, y, adjustedTapsSinceOpen);
-
+ TapSuppressionHeuristics tapHeuristics = new TapSuppressionHeuristics(
+ this, mLastTapState, x, y, adjustedTapsSinceOpen, contextualSearchContext);
// TODO(donnd): Move to be called when the panel closes to work with states that change.
tapHeuristics.logConditionState();

Powered by Google App Engine
This is Rietveld 408576698