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_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 6 #define CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 22 matching lines...) Expand all Loading... |
33 class PrefRegistrySimple; | 33 class PrefRegistrySimple; |
34 | 34 |
35 namespace browser_watcher { | 35 namespace browser_watcher { |
36 class WatcherMetricsProviderWin; | 36 class WatcherMetricsProviderWin; |
37 } // namespace browser_watcher | 37 } // namespace browser_watcher |
38 | 38 |
39 namespace metrics { | 39 namespace metrics { |
40 class DriveMetricsProvider; | 40 class DriveMetricsProvider; |
41 class MetricsService; | 41 class MetricsService; |
42 class MetricsStateManager; | 42 class MetricsStateManager; |
| 43 class NetworkMetricsProvider; |
43 class ProfilerMetricsProvider; | 44 class ProfilerMetricsProvider; |
44 } // namespace metrics | 45 } // namespace metrics |
45 | 46 |
| 47 namespace net { |
| 48 class NetworkQualityEstimator; |
| 49 } // namespace net |
| 50 |
46 // ChromeMetricsServiceClient provides an implementation of MetricsServiceClient | 51 // ChromeMetricsServiceClient provides an implementation of MetricsServiceClient |
47 // that depends on chrome/. | 52 // that depends on chrome/. |
48 class ChromeMetricsServiceClient | 53 class ChromeMetricsServiceClient |
49 : public metrics::MetricsServiceClient, | 54 : public metrics::MetricsServiceClient, |
50 public metrics::TrackingSynchronizerObserver, | 55 public metrics::TrackingSynchronizerObserver, |
51 public content::NotificationObserver { | 56 public content::NotificationObserver { |
52 public: | 57 public: |
53 ~ChromeMetricsServiceClient() override; | 58 ~ChromeMetricsServiceClient() override; |
54 | 59 |
55 // Factory function. | 60 // Factory function. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 void RegisterForNotifications(); | 134 void RegisterForNotifications(); |
130 | 135 |
131 // content::NotificationObserver: | 136 // content::NotificationObserver: |
132 void Observe(int type, | 137 void Observe(int type, |
133 const content::NotificationSource& source, | 138 const content::NotificationSource& source, |
134 const content::NotificationDetails& details) override; | 139 const content::NotificationDetails& details) override; |
135 | 140 |
136 // Called when a URL is opened from the Omnibox. | 141 // Called when a URL is opened from the Omnibox. |
137 void OnURLOpenedFromOmnibox(OmniboxLog* log); | 142 void OnURLOpenedFromOmnibox(OmniboxLog* log); |
138 | 143 |
| 144 // Provides the network quality estimator to |network_metrics_provider|. |
| 145 void ProvideNetworkQualityEstimator( |
| 146 net::NetworkQualityEstimator* network_quality_estimator) const; |
| 147 |
139 #if defined(OS_WIN) | 148 #if defined(OS_WIN) |
140 // Counts (and removes) the browser crash dump attempt signals left behind by | 149 // Counts (and removes) the browser crash dump attempt signals left behind by |
141 // any previous browser processes which generated a crash dump. | 150 // any previous browser processes which generated a crash dump. |
142 void CountBrowserCrashDumpAttempts(); | 151 void CountBrowserCrashDumpAttempts(); |
143 #endif // OS_WIN | 152 #endif // OS_WIN |
144 | 153 |
145 base::ThreadChecker thread_checker_; | 154 base::ThreadChecker thread_checker_; |
146 | 155 |
147 // Weak pointer to the MetricsStateManager. | 156 // Weak pointer to the MetricsStateManager. |
148 metrics::MetricsStateManager* metrics_state_manager_; | 157 metrics::MetricsStateManager* metrics_state_manager_; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 221 |
213 // Subscription for receiving callbacks that a URL was opened from the | 222 // Subscription for receiving callbacks that a URL was opened from the |
214 // omnibox. | 223 // omnibox. |
215 std::unique_ptr<base::CallbackList<void(OmniboxLog*)>::Subscription> | 224 std::unique_ptr<base::CallbackList<void(OmniboxLog*)>::Subscription> |
216 omnibox_url_opened_subscription_; | 225 omnibox_url_opened_subscription_; |
217 | 226 |
218 // Whether this client has already uploaded profiler data during this session. | 227 // Whether this client has already uploaded profiler data during this session. |
219 // Profiler data is uploaded at most once per session. | 228 // Profiler data is uploaded at most once per session. |
220 bool has_uploaded_profiler_data_; | 229 bool has_uploaded_profiler_data_; |
221 | 230 |
| 231 // The NetworkMetricsProvider instance that was registered with |
| 232 // MetricsService. Has the same lifetime as |metrics_service_|. |
| 233 metrics::NetworkMetricsProvider* network_metrics_provider_; |
| 234 |
222 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; | 235 base::WeakPtrFactory<ChromeMetricsServiceClient> weak_ptr_factory_; |
223 | 236 |
224 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); | 237 DISALLOW_COPY_AND_ASSIGN(ChromeMetricsServiceClient); |
225 }; | 238 }; |
226 | 239 |
227 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ | 240 #endif // CHROME_BROWSER_METRICS_CHROME_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |