Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h |
index c6d697458acde038a310216756790198aa0c42ac..a3de1d18cdecd9e1e9c06fb23b7cc1fa108d85c1 100644 |
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h |
@@ -55,6 +55,16 @@ enum LoFiImplicitOptOutAction { |
LO_FI_OPT_OUT_ACTION_INDEX_BOUNDARY, |
}; |
+// Values of the UMA DataReductionProxy.EnabledState histogram. |
+// This enum must remain synchronized with |
+// DataReductionProxyEnabledState in |
+// metrics/histograms/histograms.xml. |
+enum DataReductionSettingsEnabledAction { |
+ DATA_REDUCTION_SETTINGS_ACTION_OFF_TO_ON = 0, |
+ DATA_REDUCTION_SETTINGS_ACTION_ON_TO_OFF, |
+ DATA_REDUCTION_SETTINGS_ACTION_BOUNDARY, |
+}; |
+ |
// Central point for configuring the data reduction proxy. |
// This object lives on the UI thread and all of its methods are expected to |
// be called from there. |
@@ -205,6 +215,11 @@ class DataReductionProxySettings : public DataReductionProxyServiceObserver { |
virtual void RecordStartupState( |
data_reduction_proxy::ProxyStartupState state); |
+ // Virtualized for mocking. Records UMA whenever user toggles the |
+ // ON/OFF in settings UI |
+ virtual void RecordSettingsEnabledState( |
+ data_reduction_proxy::DataReductionSettingsEnabledAction action); |
+ |
private: |
friend class DataReductionProxySettingsTestBase; |
friend class DataReductionProxySettingsTest; |
@@ -236,6 +251,8 @@ class DataReductionProxySettings : public DataReductionProxyServiceObserver { |
TestLoFiImplicitOptOutHistograms); |
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest, |
TestLoFiSessionStateHistograms); |
+ FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest, |
sclittle
2015/10/09 20:52:48
I don't think you need this FRIEND_TEST_ALL_PREFIX
Raj
2015/10/10 01:51:47
TestSettingsEnabledStateHistograms() calls setting
|
+ TestSettingsEnabledStateHistograms); |
// Override of DataReductionProxyService::Observer. |
void OnServiceInitialized() override; |