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

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: Reworked the cache to use a stored preference instead of session static data. Created 4 years, 3 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/ContextualSearchUma.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/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 57a205f6360986f9523878b5c87490b083d11412..3a3630cd1a4f1a7eaba0adcdffa1033996b49b39 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,18 @@ public class ContextualSearchSelectionController {
ChromePreferenceManager prefs = ChromePreferenceManager.getInstance(mActivity);
int adjustedTapsSinceOpen = prefs.getContextualSearchTapCount()
- prefs.getContextualSearchTapQuickAnswerCount();
- TapSuppressionHeuristics tapHeuristics =
+ // Explicitly destroy the old heuristics so native code can dispose data.
+ 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 {
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698