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 1e8030cfdfd61e9b6d006244cc0ea7c3c8964142..e182cb585e05b2fd71352041b683882c561c78b7 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 CTRRecorder mCtrRecorder; |
+ |
/** |
* 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(); |
+ mCtrRecorder = new CTRRecorder(selectionController.getActivity()); |
+ mHeuristics.add(mCtrRecorder); |
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 (mCtrRecorder != null) { |
+ mCtrRecorder.destroy(); |
+ mCtrRecorder = 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. |