| 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 #include "chrome/browser/task_manager/task_manager_resource_providers.h" | 5 #include "chrome/browser/task_manager/task_manager_resource_providers.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 content::NotificationService::AllBrowserContextsAndSources()); | 414 content::NotificationService::AllBrowserContextsAndSources()); |
| 415 registrar_.Add(this, chrome::NOTIFICATION_INSTANT_COMMITTED, | 415 registrar_.Add(this, chrome::NOTIFICATION_INSTANT_COMMITTED, |
| 416 content::NotificationService::AllBrowserContextsAndSources()); | 416 content::NotificationService::AllBrowserContextsAndSources()); |
| 417 } | 417 } |
| 418 | 418 |
| 419 void TaskManagerTabContentsResourceProvider::StopUpdating() { | 419 void TaskManagerTabContentsResourceProvider::StopUpdating() { |
| 420 DCHECK(updating_); | 420 DCHECK(updating_); |
| 421 updating_ = false; | 421 updating_ = false; |
| 422 | 422 |
| 423 // Then we unregister for notifications to get new tabs. | 423 // Then we unregister for notifications to get new tabs. |
| 424 registrar_.Remove( | 424 registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, |
| 425 this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED, | |
| 426 content::NotificationService::AllBrowserContextsAndSources()); | 425 content::NotificationService::AllBrowserContextsAndSources()); |
| 427 registrar_.Remove( | 426 registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_SWAPPED, |
| 428 this, content::NOTIFICATION_WEB_CONTENTS_SWAPPED, | |
| 429 content::NotificationService::AllBrowserContextsAndSources()); | 427 content::NotificationService::AllBrowserContextsAndSources()); |
| 430 registrar_.Remove( | 428 registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, |
| 431 this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, | |
| 432 content::NotificationService::AllBrowserContextsAndSources()); | 429 content::NotificationService::AllBrowserContextsAndSources()); |
| 433 registrar_.Remove( | 430 registrar_.Remove(this, chrome::NOTIFICATION_INSTANT_COMMITTED, |
| 434 this, chrome::NOTIFICATION_INSTANT_COMMITTED, | |
| 435 content::NotificationService::AllBrowserContextsAndSources()); | 431 content::NotificationService::AllBrowserContextsAndSources()); |
| 436 | 432 |
| 437 // Delete all the resources. | 433 // Delete all the resources. |
| 438 STLDeleteContainerPairSecondPointers(resources_.begin(), resources_.end()); | 434 STLDeleteContainerPairSecondPointers(resources_.begin(), resources_.end()); |
| 439 | 435 |
| 440 resources_.clear(); | 436 resources_.clear(); |
| 441 } | 437 } |
| 442 | 438 |
| 443 void TaskManagerTabContentsResourceProvider::AddToTaskManager( | 439 void TaskManagerTabContentsResourceProvider::AddToTaskManager( |
| 444 TabContents* tab_contents) { | 440 TabContents* tab_contents) { |
| (...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1696 | 1692 |
| 1697 return &resource_; | 1693 return &resource_; |
| 1698 } | 1694 } |
| 1699 | 1695 |
| 1700 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { | 1696 void TaskManagerBrowserProcessResourceProvider::StartUpdating() { |
| 1701 task_manager_->AddResource(&resource_); | 1697 task_manager_->AddResource(&resource_); |
| 1702 } | 1698 } |
| 1703 | 1699 |
| 1704 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { | 1700 void TaskManagerBrowserProcessResourceProvider::StopUpdating() { |
| 1705 } | 1701 } |
| OLD | NEW |