OLD | NEW |
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 <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "chrome/browser/metrics/metrics_service_accessor.h" | 13 #include "chrome/browser/metrics/metrics_service_accessor.h" |
14 | 14 |
15 class ChromeBrowserMetricsServiceObserver; | 15 class ChromeBrowserMetricsServiceObserver; |
| 16 class ChromeExtensionDownloaderFactory; |
16 class Profile; | 17 class Profile; |
17 | 18 |
18 namespace { | 19 namespace { |
19 class CrashesDOMHandler; | 20 class CrashesDOMHandler; |
20 class FlashDOMHandler; | 21 class FlashDOMHandler; |
21 } | 22 } |
22 | 23 |
23 namespace extensions { | 24 namespace extensions { |
24 class ExtensionDownloader; | |
25 class ManifestFetchData; | |
26 class MetricsPrivateGetIsCrashReportingEnabledFunction; | 25 class MetricsPrivateGetIsCrashReportingEnabledFunction; |
27 } | 26 } |
28 | 27 |
29 namespace prerender { | 28 namespace prerender { |
30 bool IsOmniboxEnabled(Profile* profile); | 29 bool IsOmniboxEnabled(Profile* profile); |
31 } | 30 } |
32 | 31 |
33 namespace system_logs { | 32 namespace system_logs { |
34 class ChromeInternalLogSource; | 33 class ChromeInternalLogSource; |
35 } | 34 } |
36 | 35 |
37 // This class limits and documents access to metrics service helper methods. | 36 // This class limits and documents access to metrics service helper methods. |
38 // Since these methods are private, each user has to be explicitly declared | 37 // Since these methods are private, each user has to be explicitly declared |
39 // as a 'friend' below. | 38 // as a 'friend' below. |
40 class ChromeMetricsServiceAccessor : public MetricsServiceAccessor { | 39 class ChromeMetricsServiceAccessor : public MetricsServiceAccessor { |
41 private: | 40 private: |
42 friend bool prerender::IsOmniboxEnabled(Profile* profile); | 41 friend bool prerender::IsOmniboxEnabled(Profile* profile); |
43 friend class ::ChromeBrowserMetricsServiceObserver; | 42 friend class ::ChromeBrowserMetricsServiceObserver; |
| 43 friend class ChromeExtensionDownloaderFactory; |
44 friend class ChromeRenderMessageFilter; | 44 friend class ChromeRenderMessageFilter; |
45 friend class ::CrashesDOMHandler; | 45 friend class ::CrashesDOMHandler; |
46 friend class DataReductionProxyChromeSettings; | 46 friend class DataReductionProxyChromeSettings; |
47 friend class extensions::ExtensionDownloader; | |
48 friend class extensions::ManifestFetchData; | |
49 friend class extensions::MetricsPrivateGetIsCrashReportingEnabledFunction; | 47 friend class extensions::MetricsPrivateGetIsCrashReportingEnabledFunction; |
50 friend class ::FlashDOMHandler; | 48 friend class ::FlashDOMHandler; |
51 friend class system_logs::ChromeInternalLogSource; | 49 friend class system_logs::ChromeInternalLogSource; |
52 friend class UmaSessionStats; | 50 friend class UmaSessionStats; |
53 | 51 |
54 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, | 52 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, |
55 MetricsReportingEnabled); | 53 MetricsReportingEnabled); |
56 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, | 54 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, |
57 CrashReportingEnabled); | 55 CrashReportingEnabled); |
58 | 56 |
(...skipping 21 matching lines...) Expand all Loading... |
80 // Same as RegisterSyntheticFieldTrial above, but takes a hash for the trial | 78 // Same as RegisterSyntheticFieldTrial above, but takes a hash for the trial |
81 // name, rather than computing it from the string. | 79 // name, rather than computing it from the string. |
82 static bool RegisterSyntheticFieldTrialWithNameHash( | 80 static bool RegisterSyntheticFieldTrialWithNameHash( |
83 uint32_t trial_name_hash, | 81 uint32_t trial_name_hash, |
84 const std::string& group_name); | 82 const std::string& group_name); |
85 | 83 |
86 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeMetricsServiceAccessor); | 84 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeMetricsServiceAccessor); |
87 }; | 85 }; |
88 | 86 |
89 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ | 87 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ |
OLD | NEW |