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

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

Issue 2285633004: [TTS] Record CTR by week and 28-day intervals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ctr
Patch Set: Changed histogram logging to the percent-specific call. Created 4 years, 4 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 6234318ec73fae0d255163bce462adb6a5ece342..6dbe3e6afd0db9fb61b7945c1322e73a8d283441 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
@@ -67,6 +67,7 @@ public class ContextualSearchSelectionController {
private boolean mWasTapGestureDetected;
// Reflects whether the last tap was valid and whether we still have a tap-based selection.
private ContextualSearchTapState mLastTapState;
+ private TapSuppressionHeuristics mTapHeuristics;
private boolean mIsWaitingForInvalidTapDetection;
private boolean mIsSelectionEstablished;
private boolean mShouldHandleSelectionModification;
@@ -372,16 +373,17 @@ public class ContextualSearchSelectionController {
ChromePreferenceManager prefs = ChromePreferenceManager.getInstance(mActivity);
int adjustedTapsSinceOpen = prefs.getContextualSearchTapCount()
- prefs.getContextualSearchTapQuickAnswerCount();
- TapSuppressionHeuristics tapHeuristics =
+ if (mTapHeuristics != null) mTapHeuristics.destroy();
+ mTapHeuristics =
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();
+ mTapHeuristics.logConditionState();
// 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);
+ mHandler.handleMetricsForWouldSuppressTap(mTapHeuristics);
mX = x;
mY = y;
- boolean shouldSuppressTap = tapHeuristics.shouldSuppressTap();
+ boolean shouldSuppressTap = mTapHeuristics.shouldSuppressTap();
if (shouldSuppressTap) {
mHandler.handleSuppressedTap();
} else {

Powered by Google App Engine
This is Rietveld 408576698