| 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 528 |
| 529 bool MetricsService::reporting_active() const { | 529 bool MetricsService::reporting_active() const { |
| 530 DCHECK(IsSingleThreaded()); | 530 DCHECK(IsSingleThreaded()); |
| 531 return reporting_active_; | 531 return reporting_active_; |
| 532 } | 532 } |
| 533 | 533 |
| 534 // static | 534 // static |
| 535 void MetricsService::SetUpNotifications(NotificationRegistrar* registrar, | 535 void MetricsService::SetUpNotifications(NotificationRegistrar* registrar, |
| 536 NotificationObserver* observer) { | 536 NotificationObserver* observer) { |
| 537 registrar->Add(observer, chrome::NOTIFICATION_BROWSER_OPENED, | 537 registrar->Add(observer, chrome::NOTIFICATION_BROWSER_OPENED, |
| 538 NotificationService::AllSources()); | 538 NotificationService::AllBrowserContextsAndSources()); |
| 539 registrar->Add(observer, chrome::NOTIFICATION_BROWSER_CLOSED, | 539 registrar->Add(observer, chrome::NOTIFICATION_BROWSER_CLOSED, |
| 540 NotificationService::AllSources()); | 540 NotificationService::AllSources()); |
| 541 registrar->Add(observer, content::NOTIFICATION_USER_ACTION, | 541 registrar->Add(observer, content::NOTIFICATION_USER_ACTION, |
| 542 NotificationService::AllSources()); | 542 NotificationService::AllSources()); |
| 543 registrar->Add(observer, content::NOTIFICATION_TAB_PARENTED, | 543 registrar->Add(observer, content::NOTIFICATION_TAB_PARENTED, |
| 544 NotificationService::AllSources()); | 544 NotificationService::AllSources()); |
| 545 registrar->Add(observer, content::NOTIFICATION_TAB_CLOSING, | 545 registrar->Add(observer, content::NOTIFICATION_TAB_CLOSING, |
| 546 NotificationService::AllSources()); | 546 NotificationService::AllSources()); |
| 547 registrar->Add(observer, content::NOTIFICATION_LOAD_START, | 547 registrar->Add(observer, content::NOTIFICATION_LOAD_START, |
| 548 NotificationService::AllSources()); | 548 NotificationService::AllSources()); |
| (...skipping 1144 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 |