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..0bbb87029cb947e56ba61edd2eca17e9d0439414 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; |
@@ -364,23 +366,25 @@ public class ContextualSearchSelectionController { |
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(); |
Theresa
2017/05/30 20:25:25
nit: add a blank line after this line and before t
Donn Denman
2017/05/30 23:13:25
Done.
|
+ 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); |
} |
} |