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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.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
Index: chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.java
index 5acf44b27cd1c3310f9402e9ea82b28b246173da..bbb4acb46277944de7a1bba3dfa309a8bef5b8d2 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.java
@@ -8,6 +8,8 @@ package org.chromium.chrome.browser.contextualsearch;
* A set of {@link ContextualSearchHeuristic}s that support experimentation and logging.
*/
public class TapSuppressionHeuristics extends ContextualSearchHeuristics {
+ private CtrSuppression mCtrSuppression;
+
/**
* Gets all the heuristics needed for Tap suppression.
* @param selectionController The {@link ContextualSearchSelectionController}.
@@ -19,6 +21,8 @@ public class TapSuppressionHeuristics extends ContextualSearchHeuristics {
TapSuppressionHeuristics(ContextualSearchSelectionController selectionController,
ContextualSearchTapState previousTapState, int x, int y, int tapsSinceOpen) {
super();
+ mCtrSuppression = new CtrSuppression(selectionController.getActivity());
+ mHeuristics.add(mCtrSuppression);
RecentScrollTapSuppression scrollTapExperiment =
new RecentScrollTapSuppression(selectionController);
mHeuristics.add(scrollTapExperiment);
@@ -38,6 +42,17 @@ public class TapSuppressionHeuristics extends ContextualSearchHeuristics {
}
/**
+ * This method should be called to clean up storage when an instance of this class is
+ * no longer in use.
+ */
+ public void destroy() {
+ if (mCtrSuppression != null) {
+ mCtrSuppression.destroy();
+ mCtrSuppression = null;
+ }
+ }
+
+ /**
* Logs the results seen for the heuristics and whether they would have had their condition
* satisfied if enabled.
* @param wasSearchContentViewSeen Whether the panel contents were seen.

Powered by Google App Engine
This is Rietveld 408576698