OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file defines a service that collects information about the user | 5 // This file defines a service that collects information about the user |
6 // experience in order to help improve future versions of the app. | 6 // experience in order to help improve future versions of the app. |
7 | 7 |
8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 class TemplateURLService; | 39 class TemplateURLService; |
40 | 40 |
41 namespace base { | 41 namespace base { |
42 class DictionaryValue; | 42 class DictionaryValue; |
43 class MessageLoopProxy; | 43 class MessageLoopProxy; |
44 } | 44 } |
45 | 45 |
46 namespace content { | 46 namespace content { |
47 class RenderProcessHost; | 47 class RenderProcessHost; |
48 class WebContents; | 48 class WebContents; |
| 49 struct WebPluginInfo; |
49 } | 50 } |
50 | 51 |
51 namespace extensions { | 52 namespace extensions { |
52 class ExtensionDownloader; | 53 class ExtensionDownloader; |
53 class ManifestFetchData; | 54 class ManifestFetchData; |
54 } | 55 } |
55 | 56 |
56 namespace net { | 57 namespace net { |
57 class URLFetcher; | 58 class URLFetcher; |
58 } | 59 } |
59 | 60 |
60 namespace prerender { | 61 namespace prerender { |
61 bool IsOmniboxEnabled(Profile* profile); | 62 bool IsOmniboxEnabled(Profile* profile); |
62 } | 63 } |
63 | 64 |
64 namespace tracked_objects { | 65 namespace tracked_objects { |
65 struct ProcessDataSnapshot; | 66 struct ProcessDataSnapshot; |
66 } | 67 } |
67 | 68 |
68 namespace webkit { | |
69 struct WebPluginInfo; | |
70 } | |
71 | |
72 class MetricsService | 69 class MetricsService |
73 : public chrome_browser_metrics::TrackingSynchronizerObserver, | 70 : public chrome_browser_metrics::TrackingSynchronizerObserver, |
74 public content::BrowserChildProcessObserver, | 71 public content::BrowserChildProcessObserver, |
75 public content::NotificationObserver, | 72 public content::NotificationObserver, |
76 public net::URLFetcherDelegate, | 73 public net::URLFetcherDelegate, |
77 public MetricsServiceBase { | 74 public MetricsServiceBase { |
78 public: | 75 public: |
79 MetricsService(); | 76 MetricsService(); |
80 virtual ~MetricsService(); | 77 virtual ~MetricsService(); |
81 | 78 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 static void InitTaskGetHardwareClass(base::WeakPtr<MetricsService> self, | 226 static void InitTaskGetHardwareClass(base::WeakPtr<MetricsService> self, |
230 base::MessageLoopProxy* target_loop); | 227 base::MessageLoopProxy* target_loop); |
231 | 228 |
232 // Callback from InitTaskGetHardwareClass() that continues the init task by | 229 // Callback from InitTaskGetHardwareClass() that continues the init task by |
233 // loading plugin information. | 230 // loading plugin information. |
234 void OnInitTaskGotHardwareClass(const std::string& hardware_class); | 231 void OnInitTaskGotHardwareClass(const std::string& hardware_class); |
235 | 232 |
236 // Callback from PluginService::GetPlugins() that continues the init task by | 233 // Callback from PluginService::GetPlugins() that continues the init task by |
237 // launching a task to gather Google Update statistics. | 234 // launching a task to gather Google Update statistics. |
238 void OnInitTaskGotPluginInfo( | 235 void OnInitTaskGotPluginInfo( |
239 const std::vector<webkit::WebPluginInfo>& plugins); | 236 const std::vector<content::WebPluginInfo>& plugins); |
240 | 237 |
241 // Task launched by OnInitTaskGotPluginInfo() that continues the init task by | 238 // Task launched by OnInitTaskGotPluginInfo() that continues the init task by |
242 // loading Google Update statistics. Called on a blocking pool thread. | 239 // loading Google Update statistics. Called on a blocking pool thread. |
243 static void InitTaskGetGoogleUpdateData(base::WeakPtr<MetricsService> self, | 240 static void InitTaskGetGoogleUpdateData(base::WeakPtr<MetricsService> self, |
244 base::MessageLoopProxy* target_loop); | 241 base::MessageLoopProxy* target_loop); |
245 | 242 |
246 // Callback from InitTaskGetGoogleUpdateData() that continues the init task by | 243 // Callback from InitTaskGetGoogleUpdateData() that continues the init task by |
247 // loading profiler data. | 244 // loading profiler data. |
248 void OnInitTaskGotGoogleUpdateData( | 245 void OnInitTaskGotGoogleUpdateData( |
249 const GoogleUpdateMetrics& google_update_metrics); | 246 const GoogleUpdateMetrics& google_update_metrics); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 // state. | 408 // state. |
412 State state_; | 409 State state_; |
413 | 410 |
414 // Chrome OS hardware class (e.g., hardware qualification ID). This | 411 // Chrome OS hardware class (e.g., hardware qualification ID). This |
415 // class identifies the configured system components such as CPU, | 412 // class identifies the configured system components such as CPU, |
416 // WiFi adapter, etc. For non Chrome OS hosts, this will be an | 413 // WiFi adapter, etc. For non Chrome OS hosts, this will be an |
417 // empty string. | 414 // empty string. |
418 std::string hardware_class_; | 415 std::string hardware_class_; |
419 | 416 |
420 // The list of plugins which was retrieved on the file thread. | 417 // The list of plugins which was retrieved on the file thread. |
421 std::vector<webkit::WebPluginInfo> plugins_; | 418 std::vector<content::WebPluginInfo> plugins_; |
422 | 419 |
423 // Google Update statistics, which were retrieved on a blocking pool thread. | 420 // Google Update statistics, which were retrieved on a blocking pool thread. |
424 GoogleUpdateMetrics google_update_metrics_; | 421 GoogleUpdateMetrics google_update_metrics_; |
425 | 422 |
426 // The initial log, used to record startup metrics. | 423 // The initial log, used to record startup metrics. |
427 scoped_ptr<MetricsLog> initial_log_; | 424 scoped_ptr<MetricsLog> initial_log_; |
428 | 425 |
429 // The outstanding transmission appears as a URL Fetch operation. | 426 // The outstanding transmission appears as a URL Fetch operation. |
430 scoped_ptr<net::URLFetcher> current_fetch_; | 427 scoped_ptr<net::URLFetcher> current_fetch_; |
431 | 428 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 friend class extensions::ExtensionDownloader; | 504 friend class extensions::ExtensionDownloader; |
508 friend class extensions::ManifestFetchData; | 505 friend class extensions::ManifestFetchData; |
509 | 506 |
510 // Returns true if prefs::kMetricsReportingEnabled is set. | 507 // Returns true if prefs::kMetricsReportingEnabled is set. |
511 static bool IsMetricsReportingEnabled(); | 508 static bool IsMetricsReportingEnabled(); |
512 | 509 |
513 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 510 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
514 }; | 511 }; |
515 | 512 |
516 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 513 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
OLD | NEW |