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

Side by Side Diff: chrome/browser/metrics/chrome_metrics_service_accessor.h

Issue 421653005: Adding synthetic field trial for DataReductionProxyEnabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@newPltWithCL
Patch Set: Addressed comments Created 6 years, 4 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
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 CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ 5 #ifndef CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_
6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ 6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_
7 7
8 #include "base/gtest_prod_util.h" 8 #include "base/gtest_prod_util.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "chrome/browser/metrics/metrics_service_accessor.h" 10 #include "chrome/browser/metrics/metrics_service_accessor.h"
(...skipping 22 matching lines...) Expand all
33 33
34 // This class limits and documents access to metrics service helper methods. 34 // This class limits and documents access to metrics service helper methods.
35 // Since these methods are private, each user has to be explicitly declared 35 // Since these methods are private, each user has to be explicitly declared
36 // as a 'friend' below. 36 // as a 'friend' below.
37 class ChromeMetricsServiceAccessor : public MetricsServiceAccessor { 37 class ChromeMetricsServiceAccessor : public MetricsServiceAccessor {
38 private: 38 private:
39 friend bool prerender::IsOmniboxEnabled(Profile* profile); 39 friend bool prerender::IsOmniboxEnabled(Profile* profile);
40 friend class ::ChromeBrowserMetricsServiceObserver; 40 friend class ::ChromeBrowserMetricsServiceObserver;
41 friend class ChromeRenderMessageFilter; 41 friend class ChromeRenderMessageFilter;
42 friend class ::CrashesDOMHandler; 42 friend class ::CrashesDOMHandler;
43 friend class DataReductionProxyChromeSettings;
43 friend class extensions::ExtensionDownloader; 44 friend class extensions::ExtensionDownloader;
44 friend class extensions::ManifestFetchData; 45 friend class extensions::ManifestFetchData;
45 friend class extensions::MetricsPrivateGetIsCrashReportingEnabledFunction; 46 friend class extensions::MetricsPrivateGetIsCrashReportingEnabledFunction;
46 friend class ::FlashDOMHandler; 47 friend class ::FlashDOMHandler;
47 friend class system_logs::ChromeInternalLogSource; 48 friend class system_logs::ChromeInternalLogSource;
48 49
49 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, 50 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest,
50 MetricsReportingEnabled); 51 MetricsReportingEnabled);
51 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, 52 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest,
52 CrashReportingEnabled); 53 CrashReportingEnabled);
53 54
54 // Returns true if prefs::kMetricsReportingEnabled is set. 55 // Returns true if prefs::kMetricsReportingEnabled is set.
55 // TODO(asvitkine): Consolidate the method in MetricsStateManager. 56 // TODO(asvitkine): Consolidate the method in MetricsStateManager.
56 // TODO(asvitkine): This function does not report the correct value on 57 // TODO(asvitkine): This function does not report the correct value on
57 // Android and ChromeOS, see http://crbug.com/362192. 58 // Android and ChromeOS, see http://crbug.com/362192.
58 static bool IsMetricsReportingEnabled(); 59 static bool IsMetricsReportingEnabled();
59 60
60 // Returns true if crash reporting is enabled. This is set at the platform 61 // Returns true if crash reporting is enabled. This is set at the platform
61 // level for Android and ChromeOS, and otherwise is the same as 62 // level for Android and ChromeOS, and otherwise is the same as
62 // IsMetricsReportingEnabled for desktop Chrome. 63 // IsMetricsReportingEnabled for desktop Chrome.
63 static bool IsCrashReportingEnabled(); 64 static bool IsCrashReportingEnabled();
64 65
66 // Registers a field trial name and group to be used to annotate a UMA report
67 // with a particular Chrome configuration state. A UMA report will be
68 // annotated with this trial group if and only if all events in the report
69 // were created after the trial is registered. Only one group name may be
70 // registered at a time for a given trial name. Only the last group name that
71 // is registered for a given trial name will be recorded. The values passed
72 // in must not correspond to any real field trial in the code.
73 static bool RegisterSyntheticFieldTrial(const std::string& trial,
74 const std::string& group);
75
65 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeMetricsServiceAccessor); 76 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeMetricsServiceAccessor);
66 }; 77 };
67 78
68 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ 79 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698