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. |