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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 NotificationService::AllSources()); | 556 NotificationService::AllSources()); |
557 registrar->Add(observer, content::NOTIFICATION_CHILD_INSTANCE_CREATED, | 557 registrar->Add(observer, content::NOTIFICATION_CHILD_INSTANCE_CREATED, |
558 NotificationService::AllSources()); | 558 NotificationService::AllSources()); |
559 registrar->Add(observer, content::NOTIFICATION_CHILD_PROCESS_CRASHED, | 559 registrar->Add(observer, content::NOTIFICATION_CHILD_PROCESS_CRASHED, |
560 NotificationService::AllSources()); | 560 NotificationService::AllSources()); |
561 registrar->Add(observer, chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, | 561 registrar->Add(observer, chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED, |
562 NotificationService::AllSources()); | 562 NotificationService::AllSources()); |
563 registrar->Add(observer, chrome::NOTIFICATION_OMNIBOX_OPENED_URL, | 563 registrar->Add(observer, chrome::NOTIFICATION_OMNIBOX_OPENED_URL, |
564 NotificationService::AllSources()); | 564 NotificationService::AllSources()); |
565 registrar->Add(observer, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, | 565 registrar->Add(observer, chrome::NOTIFICATION_BOOKMARK_MODEL_LOADED, |
566 NotificationService::AllSources()); | 566 NotificationService::AllBrowserContextsAndSources()); |
567 } | 567 } |
568 | 568 |
569 void MetricsService::Observe(int type, | 569 void MetricsService::Observe(int type, |
570 const NotificationSource& source, | 570 const NotificationSource& source, |
571 const NotificationDetails& details) { | 571 const NotificationDetails& details) { |
572 DCHECK(current_log_); | 572 DCHECK(current_log_); |
573 DCHECK(IsSingleThreaded()); | 573 DCHECK(IsSingleThreaded()); |
574 | 574 |
575 if (!CanLogNotification(type, source, details)) | 575 if (!CanLogNotification(type, source, details)) |
576 return; | 576 return; |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 thread_id = base::PlatformThread::CurrentId(); | 1693 thread_id = base::PlatformThread::CurrentId(); |
1694 return base::PlatformThread::CurrentId() == thread_id; | 1694 return base::PlatformThread::CurrentId() == thread_id; |
1695 } | 1695 } |
1696 | 1696 |
1697 #if defined(OS_CHROMEOS) | 1697 #if defined(OS_CHROMEOS) |
1698 void MetricsService::StartExternalMetrics() { | 1698 void MetricsService::StartExternalMetrics() { |
1699 external_metrics_ = new chromeos::ExternalMetrics; | 1699 external_metrics_ = new chromeos::ExternalMetrics; |
1700 external_metrics_->Start(); | 1700 external_metrics_->Start(); |
1701 } | 1701 } |
1702 #endif | 1702 #endif |
OLD | NEW |