Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(756)

Unified Diff: chrome/browser/task_manager/task_manager_resource_providers.cc

Issue 11190016: Do not add TabContents from packaged apps to the task manager. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698