| 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_reporting_state.h" | 13 #include "chrome/browser/metrics/metrics_reporting_state.h" |
| 14 #include "chrome/browser/metrics/metrics_service_accessor.h" | 14 #include "chrome/browser/metrics/metrics_service_accessor.h" |
| 15 | 15 |
| 16 class ChromeExtensionDownloaderFactory; |
| 16 class PrefService; | 17 class PrefService; |
| 17 class Profile; | 18 class Profile; |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 class CrashesDOMHandler; | 21 class CrashesDOMHandler; |
| 21 class FlashDOMHandler; | 22 class FlashDOMHandler; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace component_updater { | 25 namespace component_updater { |
| 25 class ComponentUpdateService; | 26 class ComponentUpdateService; |
| 26 void RegisterSwReporterComponent(ComponentUpdateService* cus, | 27 void RegisterSwReporterComponent(ComponentUpdateService* cus, |
| 27 PrefService* prefs); | 28 PrefService* prefs); |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace extensions { | 31 namespace extensions { |
| 31 class ExtensionDownloader; | |
| 32 class ManifestFetchData; | |
| 33 class MetricsPrivateGetIsCrashReportingEnabledFunction; | 32 class MetricsPrivateGetIsCrashReportingEnabledFunction; |
| 34 } | 33 } |
| 35 | 34 |
| 36 namespace prerender { | 35 namespace prerender { |
| 37 bool IsOmniboxEnabled(Profile* profile); | 36 bool IsOmniboxEnabled(Profile* profile); |
| 38 } | 37 } |
| 39 | 38 |
| 40 namespace system_logs { | 39 namespace system_logs { |
| 41 class ChromeInternalLogSource; | 40 class ChromeInternalLogSource; |
| 42 } | 41 } |
| 43 | 42 |
| 44 namespace options { | 43 namespace options { |
| 45 class BrowserOptionsHandler; | 44 class BrowserOptionsHandler; |
| 46 } | 45 } |
| 47 | 46 |
| 48 // This class limits and documents access to metrics service helper methods. | 47 // This class limits and documents access to metrics service helper methods. |
| 49 // Since these methods are private, each user has to be explicitly declared | 48 // Since these methods are private, each user has to be explicitly declared |
| 50 // as a 'friend' below. | 49 // as a 'friend' below. |
| 51 class ChromeMetricsServiceAccessor : public MetricsServiceAccessor { | 50 class ChromeMetricsServiceAccessor : public MetricsServiceAccessor { |
| 52 private: | 51 private: |
| 53 friend void component_updater::RegisterSwReporterComponent( | 52 friend void component_updater::RegisterSwReporterComponent( |
| 54 component_updater::ComponentUpdateService* cus, | 53 component_updater::ComponentUpdateService* cus, |
| 55 PrefService* prefs); | 54 PrefService* prefs); |
| 56 friend bool prerender::IsOmniboxEnabled(Profile* profile); | 55 friend bool prerender::IsOmniboxEnabled(Profile* profile); |
| 56 friend class ChromeExtensionDownloaderFactory; |
| 57 friend class ChromeRenderMessageFilter; | 57 friend class ChromeRenderMessageFilter; |
| 58 friend class ::CrashesDOMHandler; | 58 friend class ::CrashesDOMHandler; |
| 59 friend class DataReductionProxyChromeSettings; | 59 friend class DataReductionProxyChromeSettings; |
| 60 friend class extensions::ExtensionDownloader; | |
| 61 friend class extensions::ManifestFetchData; | |
| 62 friend class extensions::MetricsPrivateGetIsCrashReportingEnabledFunction; | 60 friend class extensions::MetricsPrivateGetIsCrashReportingEnabledFunction; |
| 63 friend class ::FlashDOMHandler; | 61 friend class ::FlashDOMHandler; |
| 64 friend class system_logs::ChromeInternalLogSource; | 62 friend class system_logs::ChromeInternalLogSource; |
| 65 friend class UmaSessionStats; | 63 friend class UmaSessionStats; |
| 66 friend class options::BrowserOptionsHandler; | 64 friend class options::BrowserOptionsHandler; |
| 67 friend void InitiateMetricsReportingChange( | 65 friend void InitiateMetricsReportingChange( |
| 68 bool, const OnMetricsReportingCallbackType&); | 66 bool, const OnMetricsReportingCallbackType&); |
| 69 | 67 |
| 70 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, | 68 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, |
| 71 MetricsReportingEnabled); | 69 MetricsReportingEnabled); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 96 // Same as RegisterSyntheticFieldTrial above, but takes a hash for the trial | 94 // Same as RegisterSyntheticFieldTrial above, but takes a hash for the trial |
| 97 // name, rather than computing it from the string. | 95 // name, rather than computing it from the string. |
| 98 static bool RegisterSyntheticFieldTrialWithNameHash( | 96 static bool RegisterSyntheticFieldTrialWithNameHash( |
| 99 uint32_t trial_name_hash, | 97 uint32_t trial_name_hash, |
| 100 const std::string& group_name); | 98 const std::string& group_name); |
| 101 | 99 |
| 102 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeMetricsServiceAccessor); | 100 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeMetricsServiceAccessor); |
| 103 }; | 101 }; |
| 104 | 102 |
| 105 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ | 103 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ |
| OLD | NEW |