Chromium Code Reviews| Index: chrome/browser/task_manager/task_manager_resource_providers.cc |
| diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc |
| index 88a0f56cd75c8d06e011f4e1918e4dc04d300299..60bc98af541d08245ca46216e953d61498aeb76a 100644 |
| --- a/chrome/browser/task_manager/task_manager_resource_providers.cc |
| +++ b/chrome/browser/task_manager/task_manager_resource_providers.cc |
| @@ -314,17 +314,8 @@ string16 TaskManagerTabContentsResource::GetTitle() const { |
| base::i18n::AdjustStringForLocaleDirection(&tab_title); |
| } |
| - // Only classify as an app if the URL is an app and the tab is hosting an |
| - // extension process. (It's possible to be showing the URL from before it |
| - // was installed as an app.) |
| - ExtensionService* extension_service = |
| - tab_contents_->profile()->GetExtensionService(); |
| - extensions::ProcessMap* process_map = extension_service->process_map(); |
| - bool is_app = extension_service->IsInstalledApp(url) && |
| - process_map->Contains(contents->GetRenderProcessHost()->GetID()); |
| - |
| int message_id = GetMessagePrefixID( |
| - is_app, |
| + false, // (is_app) Apps do not have TabContents |
| HostsExtension(), |
| tab_contents_->profile()->IsOffTheRecord(), |
| IsPrerendering(), |
| @@ -502,12 +493,23 @@ void TaskManagerTabContentsResourceProvider::Update(TabContents* tab_contents) { |
| void TaskManagerTabContentsResourceProvider::Observe(int type, |
| const content::NotificationSource& source, |
| const content::NotificationDetails& details) { |
| - TabContents* tab_contents; |
| - tab_contents = TabContents::FromWebContents( |
| - content::Source<WebContents>(source).ptr()); |
| + WebContents* web_contents = content::Source<WebContents>(source).ptr(); |
| + TabContents* tab_contents = TabContents::FromWebContents(web_contents); |
| // A background page does not have a TabContents. |
| if (!tab_contents) |
| return; |
| + |
| + // Only classify as an app if the URL is an app and the tab is hosting an |
| + // extension process. (It's possible to be showing the URL from before it |
| + // was installed as an app.) |
| + ExtensionService* extension_service = |
| + tab_contents->profile()->GetExtensionService(); |
| + extensions::ProcessMap* process_map = extension_service->process_map(); |
| + bool is_app = extension_service->IsInstalledApp(web_contents->GetURL()) && |
| + process_map->Contains(web_contents->GetRenderProcessHost()->GetID()); |
|
benwells
2012/10/17 05:59:49
I don't think this will work with old style packag
|
| + if (is_app) |
| + return; |
| + |
| switch (type) { |
| case content::NOTIFICATION_WEB_CONTENTS_CONNECTED: |
| Add(tab_contents); |