diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-03 05:53:20 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-03 05:53:20 +0000 |
commit | 4ca153033f022dc6e11d6094daed41b1ed0a995f (patch) | |
tree | f4720517b10953166f84707ca3ec8b82de860884 /chrome/browser/task_manager | |
parent | 08bd3d71d969061b1588e6a4210f6d74b0ec0c6d (diff) | |
download | chromium_src-4ca153033f022dc6e11d6094daed41b1ed0a995f.zip chromium_src-4ca153033f022dc6e11d6094daed41b1ed0a995f.tar.gz chromium_src-4ca153033f022dc6e11d6094daed41b1ed0a995f.tar.bz2 |
Replace most of Browser::GetSelectedTabContents calls into Browser::GetSelectedWebContents. I've converted the easy ones, I'll do the ones with more dependencies in a separate change to keep things trivial to review.
I considered taking out GetSelectedTabContents altogether and having people just use GetSelectedTabContentsWrapper()->web_contents() per the existing comment in browser.h, but there are a lot of callers and it seemed too long to type.
BUG=98716
TBR=joi
Review URL: http://codereview.chromium.org/9015022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116122 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/task_manager')
-rw-r--r-- | chrome/browser/task_manager/task_manager_resource_providers.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc index d38ad1b..50ac984 100644 --- a/chrome/browser/task_manager/task_manager_resource_providers.cc +++ b/chrome/browser/task_manager/task_manager_resource_providers.cc @@ -388,7 +388,7 @@ void TaskManagerTabContentsResourceProvider::StartUpdating() { // Then we register for notifications to get new tabs. registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_CONNECTED, content::NotificationService::AllBrowserContextsAndSources()); - registrar_.Add(this, content::NOTIFICATION_TAB_CONTENTS_SWAPPED, + registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_SWAPPED, content::NotificationService::AllBrowserContextsAndSources()); registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, content::NotificationService::AllBrowserContextsAndSources()); @@ -411,7 +411,7 @@ void TaskManagerTabContentsResourceProvider::StopUpdating() { this, content::NOTIFICATION_TAB_CONTENTS_CONNECTED, content::NotificationService::AllBrowserContextsAndSources()); registrar_.Remove( - this, content::NOTIFICATION_TAB_CONTENTS_SWAPPED, + this, content::NOTIFICATION_WEB_CONTENTS_SWAPPED, content::NotificationService::AllBrowserContextsAndSources()); registrar_.Remove( this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, @@ -500,7 +500,8 @@ void TaskManagerTabContentsResourceProvider::Observe(int type, TabContentsWrapper* tab_contents; if (type == chrome::NOTIFICATION_INSTANT_COMMITTED) { tab_contents = content::Source<TabContentsWrapper>(source).ptr(); - } else if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { + } else if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED || + type == content::NOTIFICATION_WEB_CONTENTS_SWAPPED) { WebContents* web_contents = content::Source<WebContents>(source).ptr(); tab_contents = TabContentsWrapper::GetCurrentWrapperForContents( web_contents); @@ -515,7 +516,7 @@ void TaskManagerTabContentsResourceProvider::Observe(int type, case content::NOTIFICATION_TAB_CONTENTS_CONNECTED: Add(tab_contents); break; - case content::NOTIFICATION_TAB_CONTENTS_SWAPPED: + case content::NOTIFICATION_WEB_CONTENTS_SWAPPED: Remove(tab_contents); Add(tab_contents); break; |