| 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 c2472f52a063530b64c3dc410f1714490152df36..9f296ceef16e9c55c63621923cdd967c8df31324 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
|
| @@ -351,8 +351,10 @@ 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 rankerLogger The {@link ContextualSearchRankerLogger} currently being used to measure
|
| + * or suppress the UI by Ranker.
|
| */
|
| - void handleShouldSuppressTap() {
|
| + void handleShouldSuppressTap(ContextualSearchRankerLogger rankerLogger) {
|
| int x = (int) mX;
|
| int y = (int) mY;
|
|
|
| @@ -362,25 +364,29 @@ public class ContextualSearchSelectionController {
|
| - prefs.getContextualSearchTapQuickAnswerCount();
|
| TapSuppressionHeuristics tapHeuristics =
|
| new TapSuppressionHeuristics(this, mLastTapState, x, y, adjustedTapsSinceOpen);
|
| +
|
| // TODO(donnd): Move to be called when the panel closes to work with states that change.
|
| tapHeuristics.logConditionState();
|
| +
|
| + tapHeuristics.logRankerTapSuppression(rankerLogger);
|
| // Tell the manager what it needs in order to log metrics on whether the tap would have
|
| // been suppressed if each of the heuristics were satisfied.
|
| mHandler.handleMetricsForWouldSuppressTap(tapHeuristics);
|
|
|
| - boolean shouldSuppressTap = tapHeuristics.shouldSuppressTap();
|
| + boolean shouldSuppressTapBasedOnHeuristics = tapHeuristics.shouldSuppressTap();
|
| if (mTapTimeNanoseconds != 0) {
|
| // Remember the tap state for subsequent tap evaluation.
|
| - mLastTapState =
|
| - new ContextualSearchTapState(x, y, mTapTimeNanoseconds, shouldSuppressTap);
|
| + mLastTapState = new ContextualSearchTapState(
|
| + x, y, mTapTimeNanoseconds, shouldSuppressTapBasedOnHeuristics);
|
| } else {
|
| mLastTapState = null;
|
| }
|
|
|
| - if (shouldSuppressTap) {
|
| + boolean shouldSuppressTapBasedOnRanker = rankerLogger.inferUiSuppression();
|
| + if (shouldSuppressTapBasedOnHeuristics || shouldSuppressTapBasedOnRanker) {
|
| mHandler.handleSuppressedTap();
|
| } else {
|
| - mHandler.handleNonSuppressedTap();
|
| + mHandler.handleNonSuppressedTap(mTapTimeNanoseconds);
|
| }
|
| }
|
|
|
|
|