| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 10 #pragma once |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class BookmarkNode; | 30 class BookmarkNode; |
| 31 class HistogramSynchronizer; | 31 class HistogramSynchronizer; |
| 32 class MetricsLogBase; | 32 class MetricsLogBase; |
| 33 class MetricsReportingScheduler; | 33 class MetricsReportingScheduler; |
| 34 class PrefService; | 34 class PrefService; |
| 35 class TemplateURLService; | 35 class TemplateURLService; |
| 36 | 36 |
| 37 namespace base { | 37 namespace base { |
| 38 class DictionaryValue; | 38 class DictionaryValue; |
| 39 class ListValue; | 39 class ListValue; |
| 40 class MessageLoopProxy; |
| 40 } | 41 } |
| 41 | 42 |
| 42 namespace webkit { | 43 namespace webkit { |
| 43 struct WebPluginInfo; | 44 struct WebPluginInfo; |
| 44 } | 45 } |
| 45 | 46 |
| 46 class MetricsService : public NotificationObserver, | 47 class MetricsService : public NotificationObserver, |
| 47 public URLFetcher::Delegate, | 48 public URLFetcher::Delegate, |
| 48 public MetricsServiceBase { | 49 public MetricsServiceBase { |
| 49 public: | 50 public: |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 SEND_OLD_INITIAL_LOGS, // Sending unsent logs from previous session. | 153 SEND_OLD_INITIAL_LOGS, // Sending unsent logs from previous session. |
| 153 SENDING_OLD_LOGS, // Sending unsent logs from previous session. | 154 SENDING_OLD_LOGS, // Sending unsent logs from previous session. |
| 154 SENDING_CURRENT_LOGS, // Sending standard current logs as they acrue. | 155 SENDING_CURRENT_LOGS, // Sending standard current logs as they acrue. |
| 155 }; | 156 }; |
| 156 | 157 |
| 157 enum ShutdownCleanliness { | 158 enum ShutdownCleanliness { |
| 158 CLEANLY_SHUTDOWN = 0xdeadbeef, | 159 CLEANLY_SHUTDOWN = 0xdeadbeef, |
| 159 NEED_TO_SHUTDOWN = ~CLEANLY_SHUTDOWN | 160 NEED_TO_SHUTDOWN = ~CLEANLY_SHUTDOWN |
| 160 }; | 161 }; |
| 161 | 162 |
| 162 class InitTask; | 163 // First part of the init task. Called on the FILE thread to load hardware |
| 163 class InitTaskComplete; | 164 // class information. |
| 165 void InitTaskGetHardwareClass(base::MessageLoopProxy* target_loop); |
| 164 | 166 |
| 165 // Callback to let us know that the init task is done. | 167 // Callback from InitTaskGetHardwareClass() that continues the init task by |
| 166 void OnInitTaskComplete( | 168 // loading plugin information. |
| 167 const std::string& hardware_class, | 169 void OnInitTaskGotHardwareClass(const std::string& hardware_class); |
| 170 |
| 171 // Callback from PluginService::GetPlugins() that moves the state to |
| 172 // INIT_TASK_DONE. |
| 173 void OnInitTaskGotPluginInfo( |
| 168 const std::vector<webkit::WebPluginInfo>& plugins); | 174 const std::vector<webkit::WebPluginInfo>& plugins); |
| 169 | 175 |
| 170 // When we start a new version of Chromium (different from our last run), we | 176 // When we start a new version of Chromium (different from our last run), we |
| 171 // need to discard the old crash stats so that we don't attribute crashes etc. | 177 // need to discard the old crash stats so that we don't attribute crashes etc. |
| 172 // in the old version to the current version (via current logs). | 178 // in the old version to the current version (via current logs). |
| 173 // Without this, a common reason to finally start a new version is to crash | 179 // Without this, a common reason to finally start a new version is to crash |
| 174 // the old version (after an autoupdate has arrived), and so we'd bias | 180 // the old version (after an autoupdate has arrived), and so we'd bias |
| 175 // initial results towards showing crashes :-(. | 181 // initial results towards showing crashes :-(. |
| 176 static void DiscardOldStabilityStats(PrefService* local_state); | 182 static void DiscardOldStabilityStats(PrefService* local_state); |
| 177 | 183 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 private: | 463 private: |
| 458 friend class InstantFieldTrial; | 464 friend class InstantFieldTrial; |
| 459 | 465 |
| 460 // Returns true if prefs::kMetricsReportingEnabled is set. | 466 // Returns true if prefs::kMetricsReportingEnabled is set. |
| 461 static bool IsMetricsReportingEnabled(); | 467 static bool IsMetricsReportingEnabled(); |
| 462 | 468 |
| 463 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 469 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
| 464 }; | 470 }; |
| 465 | 471 |
| 466 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 472 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |