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

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

Issue 7063015: Swap processes on reload if a hosted app has been installed/uninstalled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile on Windows Created 9 years, 7 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
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 99cb938482a27d01595a3590f2a3d82447a7b0b0..f3989c0b31c801a67488d81eda763c83ac38abb0 100644
--- a/chrome/browser/task_manager/task_manager_resource_providers.cc
+++ b/chrome/browser/task_manager/task_manager_resource_providers.cc
@@ -197,9 +197,11 @@ TaskManager::Resource::Type TaskManagerTabContentsResource::GetType() const {
string16 TaskManagerTabContentsResource::GetTitle() const {
// Fall back on the URL if there's no title.
- string16 tab_title = tab_contents_->tab_contents()->GetTitle();
+ TabContents* contents = tab_contents_->tab_contents();
+ string16 tab_title = contents->GetTitle();
+ GURL url = contents->GetURL();
if (tab_title.empty()) {
- tab_title = UTF8ToUTF16(tab_contents_->tab_contents()->GetURL().spec());
+ tab_title = UTF8ToUTF16(url.spec());
// Force URL to be LTR.
tab_title = base::i18n::GetDisplayStringInLTRDirectionality(tab_title);
} else {
@@ -215,13 +217,17 @@ 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* extensions_service =
tab_contents_->profile()->GetExtensionService();
+ bool is_app = extensions_service->IsInstalledApp(url) &&
+ contents->GetRenderProcessHost()->is_extension_process();
int message_id = GetMessagePrefixID(
- extensions_service->IsInstalledApp(
- tab_contents_->tab_contents()->GetURL()),
- tab_contents_->tab_contents()->HostsExtension(),
+ is_app,
+ contents->HostsExtension(),
tab_contents_->profile()->IsOffTheRecord(),
IsPrerendering());
return l10n_util::GetStringFUTF16(message_id, tab_title);
« no previous file with comments | « chrome/browser/task_manager/task_manager_browsertest.cc ('k') | chrome/renderer/chrome_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698