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

Side by Side 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: Addressed tbansal1 comments 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SETTIN GS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // This enum must remain synchronized with 48 // This enum must remain synchronized with
49 // DataReductionProxyLoFiImplicitOptOutAction in 49 // DataReductionProxyLoFiImplicitOptOutAction in
50 // metrics/histograms/histograms.xml. 50 // metrics/histograms/histograms.xml.
51 enum LoFiImplicitOptOutAction { 51 enum LoFiImplicitOptOutAction {
52 LO_FI_OPT_OUT_ACTION_DISABLED_FOR_SESSION = 0, 52 LO_FI_OPT_OUT_ACTION_DISABLED_FOR_SESSION = 0,
53 LO_FI_OPT_OUT_ACTION_DISABLED_UNTIL_NEXT_EPOCH, 53 LO_FI_OPT_OUT_ACTION_DISABLED_UNTIL_NEXT_EPOCH,
54 LO_FI_OPT_OUT_ACTION_NEXT_EPOCH, 54 LO_FI_OPT_OUT_ACTION_NEXT_EPOCH,
55 LO_FI_OPT_OUT_ACTION_INDEX_BOUNDARY, 55 LO_FI_OPT_OUT_ACTION_INDEX_BOUNDARY,
56 }; 56 };
57 57
58 // Values of the UMA DataReductionProxy.EnabledState histogram.
59 // This enum must remain synchronized with DataReductionProxyEnabledState
60 // in metrics/histograms/histograms.xml.
61 enum DataReductionSettingsEnabledAction {
62 DATA_REDUCTION_SETTINGS_ACTION_OFF_TO_ON = 0,
63 DATA_REDUCTION_SETTINGS_ACTION_ON_TO_OFF,
64 DATA_REDUCTION_SETTINGS_ACTION_BOUNDARY,
65 };
66
58 // Central point for configuring the data reduction proxy. 67 // Central point for configuring the data reduction proxy.
59 // This object lives on the UI thread and all of its methods are expected to 68 // This object lives on the UI thread and all of its methods are expected to
60 // be called from there. 69 // be called from there.
61 // TODO(marq): Convert this to be a KeyedService with an 70 // TODO(marq): Convert this to be a KeyedService with an
62 // associated factory class, and refactor the Java call sites accordingly. 71 // associated factory class, and refactor the Java call sites accordingly.
63 class DataReductionProxySettings : public DataReductionProxyServiceObserver { 72 class DataReductionProxySettings : public DataReductionProxyServiceObserver {
64 public: 73 public:
65 typedef base::Callback<bool(const std::string&, const std::string&)> 74 typedef base::Callback<bool(const std::string&, const std::string&)>
66 SyntheticFieldTrialRegistrationCallback; 75 SyntheticFieldTrialRegistrationCallback;
67 76
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest, 238 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
230 CheckInitMetricsWhenNotAllowed); 239 CheckInitMetricsWhenNotAllowed);
231 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest, 240 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
232 TestLoFiImplicitOptOutClicksPerSession); 241 TestLoFiImplicitOptOutClicksPerSession);
233 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest, 242 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
234 TestLoFiImplicitOptOutConsecutiveSessions); 243 TestLoFiImplicitOptOutConsecutiveSessions);
235 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest, 244 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
236 TestLoFiImplicitOptOutHistograms); 245 TestLoFiImplicitOptOutHistograms);
237 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest, 246 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
238 TestLoFiSessionStateHistograms); 247 TestLoFiSessionStateHistograms);
248 FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
249 TestSettingsEnabledStateHistograms);
239 250
240 // Override of DataReductionProxyService::Observer. 251 // Override of DataReductionProxyService::Observer.
241 void OnServiceInitialized() override; 252 void OnServiceInitialized() override;
242 253
243 // Registers the trial "SyntheticDataReductionProxySetting" with the group 254 // Registers the trial "SyntheticDataReductionProxySetting" with the group
244 // "Enabled" or "Disabled". Indicates whether the proxy is turned on or not. 255 // "Enabled" or "Disabled". Indicates whether the proxy is turned on or not.
245 void RegisterDataReductionProxyFieldTrial(); 256 void RegisterDataReductionProxyFieldTrial();
246 257
247 // Registers the trial "SyntheticDataReductionProxyLoFiSetting" with the group 258 // Registers the trial "SyntheticDataReductionProxyLoFiSetting" with the group
248 // "Enabled" or "Disabled". Indicates whether Lo-Fi is turned on or not. 259 // "Enabled" or "Disabled". Indicates whether Lo-Fi is turned on or not.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 SyntheticFieldTrialRegistrationCallback register_synthetic_field_trial_; 313 SyntheticFieldTrialRegistrationCallback register_synthetic_field_trial_;
303 314
304 base::ThreadChecker thread_checker_; 315 base::ThreadChecker thread_checker_;
305 316
306 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); 317 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings);
307 }; 318 };
308 319
309 } // namespace data_reduction_proxy 320 } // namespace data_reduction_proxy
310 321
311 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SET TINGS_H_ 322 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_SET TINGS_H_
OLDNEW
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698