| 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 "components/metrics/metrics_service_accessor.h" | 14 #include "components/metrics/metrics_service_accessor.h" |
| 15 | 15 |
| 16 class BrowserProcessImpl; | 16 class BrowserProcessImpl; |
| 17 class Profile; | 17 class Profile; |
| 18 class ChromeMetricsServiceClient; |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 class CrashesDOMHandler; | 21 class CrashesDOMHandler; |
| 21 class FlashDOMHandler; | 22 class FlashDOMHandler; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace chrome { | 25 namespace chrome { |
| 25 void AttemptRestart(); | 26 void AttemptRestart(); |
| 26 } | 27 } |
| 27 | 28 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 friend class safe_browsing::IncidentReportingService; | 93 friend class safe_browsing::IncidentReportingService; |
| 93 friend class speech::ChromeSpeechRecognitionManagerDelegate; | 94 friend class speech::ChromeSpeechRecognitionManagerDelegate; |
| 94 friend class StackSamplingConfiguration; | 95 friend class StackSamplingConfiguration; |
| 95 friend class system_logs::ChromeInternalLogSource; | 96 friend class system_logs::ChromeInternalLogSource; |
| 96 friend class UmaSessionStats; | 97 friend class UmaSessionStats; |
| 97 friend class safe_browsing::SRTFetcher; | 98 friend class safe_browsing::SRTFetcher; |
| 98 friend class safe_browsing::DownloadSBClient; | 99 friend class safe_browsing::DownloadSBClient; |
| 99 friend class safe_browsing::SafeBrowsingService; | 100 friend class safe_browsing::SafeBrowsingService; |
| 100 friend class safe_browsing::SafeBrowsingUIManager; | 101 friend class safe_browsing::SafeBrowsingUIManager; |
| 101 friend void SyzyASANRegisterExperiment(const char*, const char*); | 102 friend void SyzyASANRegisterExperiment(const char*, const char*); |
| 103 friend class ChromeMetricsServiceClient; |
| 102 | 104 |
| 103 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, | 105 FRIEND_TEST_ALL_PREFIXES(ChromeMetricsServiceAccessorTest, |
| 104 MetricsReportingEnabled); | 106 MetricsReportingEnabled); |
| 105 | 107 |
| 106 // Returns true if metrics reporting is enabled. | 108 // Returns true if metrics reporting is enabled. |
| 107 // TODO(gayane): Consolidate metric prefs on all platforms. | 109 // TODO(gayane): Consolidate metric prefs on all platforms. |
| 108 // http://crbug.com/362192, http://crbug.com/532084 | 110 // http://crbug.com/362192, http://crbug.com/532084 |
| 109 static bool IsMetricsAndCrashReportingEnabled(); | 111 static bool IsMetricsAndCrashReportingEnabled(); |
| 110 | 112 |
| 111 // Calls metrics::MetricsServiceAccessor::RegisterSyntheticFieldTrial() with | 113 // Calls metrics::MetricsServiceAccessor::RegisterSyntheticFieldTrial() with |
| 112 // g_browser_process->metrics_service(). See that function's declaration for | 114 // g_browser_process->metrics_service(). See that function's declaration for |
| 113 // details. | 115 // details. |
| 114 static bool RegisterSyntheticFieldTrial(const std::string& trial_name, | 116 static bool RegisterSyntheticFieldTrial(const std::string& trial_name, |
| 115 const std::string& group_name); | 117 const std::string& group_name); |
| 116 | 118 |
| 117 // Calls | 119 // Calls |
| 118 // metrics::MetricsServiceAccessor::RegisterSyntheticFieldTrialWithNameHash() | 120 // metrics::MetricsServiceAccessor::RegisterSyntheticFieldTrialWithNameHash() |
| 119 // with g_browser_process->metrics_service(). See that function's declaration | 121 // with g_browser_process->metrics_service(). See that function's declaration |
| 120 // for details. | 122 // for details. |
| 121 static bool RegisterSyntheticFieldTrialWithNameHash( | 123 static bool RegisterSyntheticFieldTrialWithNameHash( |
| 122 uint32_t trial_name_hash, | 124 uint32_t trial_name_hash, |
| 123 const std::string& group_name); | 125 const std::string& group_name); |
| 124 | 126 |
| 125 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeMetricsServiceAccessor); | 127 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeMetricsServiceAccessor); |
| 126 }; | 128 }; |
| 127 | 129 |
| 128 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ | 130 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_ACCESSOR_H_ |
| OLD | NEW |