| 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
| 6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
| 7 // | 7 // |
| 8 // OVERVIEW | 8 // OVERVIEW |
| 9 // | 9 // |
| 10 // A MetricsService instance is typically created at application startup. It | 10 // A MetricsService instance is typically created at application startup. It |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 #include "webkit/plugins/npapi/webplugininfo.h" | 193 #include "webkit/plugins/npapi/webplugininfo.h" |
| 194 | 194 |
| 195 // TODO(port): port browser_distribution.h. | 195 // TODO(port): port browser_distribution.h. |
| 196 #if !defined(OS_POSIX) | 196 #if !defined(OS_POSIX) |
| 197 #include "chrome/installer/util/browser_distribution.h" | 197 #include "chrome/installer/util/browser_distribution.h" |
| 198 #endif | 198 #endif |
| 199 | 199 |
| 200 #if defined(OS_CHROMEOS) | 200 #if defined(OS_CHROMEOS) |
| 201 #include "chrome/browser/chromeos/cros/cros_library.h" | 201 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 202 #include "chrome/browser/chromeos/external_metrics.h" | 202 #include "chrome/browser/chromeos/external_metrics.h" |
| 203 #include "chrome/browser/chromeos/system_access.h" | 203 #include "chrome/browser/chromeos/system/statistics_provider.h" |
| 204 #endif | 204 #endif |
| 205 | 205 |
| 206 namespace { | 206 namespace { |
| 207 MetricsService::LogRecallStatus MakeRecallStatusHistogram( | 207 MetricsService::LogRecallStatus MakeRecallStatusHistogram( |
| 208 MetricsService::LogRecallStatus status) { | 208 MetricsService::LogRecallStatus status) { |
| 209 UMA_HISTOGRAM_ENUMERATION("PrefService.PersistentLogRecall", status, | 209 UMA_HISTOGRAM_ENUMERATION("PrefService.PersistentLogRecall", status, |
| 210 MetricsService::END_RECALL_STATUS); | 210 MetricsService::END_RECALL_STATUS); |
| 211 return status; | 211 return status; |
| 212 } | 212 } |
| 213 | 213 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 class MetricsService::InitTask : public Task { | 336 class MetricsService::InitTask : public Task { |
| 337 public: | 337 public: |
| 338 explicit InitTask(MessageLoop* callback_loop) | 338 explicit InitTask(MessageLoop* callback_loop) |
| 339 : callback_loop_(callback_loop) {} | 339 : callback_loop_(callback_loop) {} |
| 340 | 340 |
| 341 virtual void Run() { | 341 virtual void Run() { |
| 342 std::vector<webkit::npapi::WebPluginInfo> plugins; | 342 std::vector<webkit::npapi::WebPluginInfo> plugins; |
| 343 webkit::npapi::PluginList::Singleton()->GetPlugins(false, &plugins); | 343 webkit::npapi::PluginList::Singleton()->GetPlugins(false, &plugins); |
| 344 std::string hardware_class; // Empty string by default. | 344 std::string hardware_class; // Empty string by default. |
| 345 #if defined(OS_CHROMEOS) | 345 #if defined(OS_CHROMEOS) |
| 346 chromeos::SystemAccess::GetInstance()->GetMachineStatistic( | 346 chromeos::system::StatisticsProvider::GetInstance()->GetMachineStatistic( |
| 347 "hardware_class", &hardware_class); | 347 "hardware_class", &hardware_class); |
| 348 #endif // OS_CHROMEOS | 348 #endif // OS_CHROMEOS |
| 349 callback_loop_->PostTask(FROM_HERE, new InitTaskComplete( | 349 callback_loop_->PostTask(FROM_HERE, new InitTaskComplete( |
| 350 hardware_class, plugins)); | 350 hardware_class, plugins)); |
| 351 } | 351 } |
| 352 | 352 |
| 353 private: | 353 private: |
| 354 MessageLoop* callback_loop_; | 354 MessageLoop* callback_loop_; |
| 355 }; | 355 }; |
| 356 | 356 |
| (...skipping 1333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 thread_id = base::PlatformThread::CurrentId(); | 1690 thread_id = base::PlatformThread::CurrentId(); |
| 1691 return base::PlatformThread::CurrentId() == thread_id; | 1691 return base::PlatformThread::CurrentId() == thread_id; |
| 1692 } | 1692 } |
| 1693 | 1693 |
| 1694 #if defined(OS_CHROMEOS) | 1694 #if defined(OS_CHROMEOS) |
| 1695 void MetricsService::StartExternalMetrics() { | 1695 void MetricsService::StartExternalMetrics() { |
| 1696 external_metrics_ = new chromeos::ExternalMetrics; | 1696 external_metrics_ = new chromeos::ExternalMetrics; |
| 1697 external_metrics_->Start(); | 1697 external_metrics_->Start(); |
| 1698 } | 1698 } |
| 1699 #endif | 1699 #endif |
| OLD | NEW |