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 #pragma once | 10 #pragma once |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 INITIAL_LOG_READY, // Initial log generated, and waiting for reply. | 145 INITIAL_LOG_READY, // Initial log generated, and waiting for reply. |
146 SENDING_OLD_LOGS, // Sending unsent logs from previous session. | 146 SENDING_OLD_LOGS, // Sending unsent logs from previous session. |
147 SENDING_CURRENT_LOGS, // Sending standard current logs as they acrue. | 147 SENDING_CURRENT_LOGS, // Sending standard current logs as they acrue. |
148 }; | 148 }; |
149 | 149 |
150 enum ShutdownCleanliness { | 150 enum ShutdownCleanliness { |
151 CLEANLY_SHUTDOWN = 0xdeadbeef, | 151 CLEANLY_SHUTDOWN = 0xdeadbeef, |
152 NEED_TO_SHUTDOWN = ~CLEANLY_SHUTDOWN | 152 NEED_TO_SHUTDOWN = ~CLEANLY_SHUTDOWN |
153 }; | 153 }; |
154 | 154 |
155 // First part of the init task. Called on the FILE thread to load hardware | 155 // First part of the init task. Starts retrieving the hardware class and |
156 // class information. | 156 // proceeds to OnInitTaskGotHardwareClass() or waits for |
157 static void InitTaskGetHardwareClass(base::WeakPtr<MetricsService> self, | 157 // OnStatisticsProviderReady(). |
158 base::MessageLoopProxy* target_loop); | 158 static void InitTaskGetHardwareClass(base::WeakPtr<MetricsService> self); |
159 | |
160 // Callback for the StatisticsProvider to signal that hardware data has been | |
161 // loaded. Retrieves the hardware class and passes it to | |
162 // OnInitTaskGotHardwareClass(). | |
163 void OnStatisticsProviderReady(); | |
Ilya Sherman
2012/04/19 19:35:32
nit: This is #ifdef'd in the implementation file,
Joao da Silva
2012/04/19 19:54:33
Of course, good catch. Done.
| |
159 | 164 |
160 // Callback from InitTaskGetHardwareClass() that continues the init task by | 165 // Callback from InitTaskGetHardwareClass() that continues the init task by |
161 // loading plugin information. | 166 // loading plugin information. |
162 void OnInitTaskGotHardwareClass(const std::string& hardware_class); | 167 void OnInitTaskGotHardwareClass(const std::string& hardware_class); |
163 | 168 |
164 // Callback from PluginService::GetPlugins() that moves the state to | 169 // Callback from PluginService::GetPlugins() that moves the state to |
165 // INIT_TASK_DONE. | 170 // INIT_TASK_DONE. |
166 void OnInitTaskGotPluginInfo( | 171 void OnInitTaskGotPluginInfo( |
167 const std::vector<webkit::WebPluginInfo>& plugins); | 172 const std::vector<webkit::WebPluginInfo>& plugins); |
168 | 173 |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 friend bool prerender::IsOmniboxEnabled(Profile* profile); | 437 friend bool prerender::IsOmniboxEnabled(Profile* profile); |
433 friend class extensions::ExtensionDownloader; | 438 friend class extensions::ExtensionDownloader; |
434 | 439 |
435 // Returns true if prefs::kMetricsReportingEnabled is set. | 440 // Returns true if prefs::kMetricsReportingEnabled is set. |
436 static bool IsMetricsReportingEnabled(); | 441 static bool IsMetricsReportingEnabled(); |
437 | 442 |
438 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 443 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
439 }; | 444 }; |
440 | 445 |
441 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 446 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
OLD | NEW |