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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h

Issue 1400903002: Data reduction proxy enabled/disabled UMA for all platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix for trybot components_unittests failure Created 5 years, 2 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: 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;

Powered by Google App Engine
This is Rietveld 408576698