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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 5526002: Show extension tabs in task manager and correctly label apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 4a225b204b31a088d38e136fab078a03a1489f51..e3efc7d39914c46289117e458224f0ba6c224875 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -586,6 +586,19 @@ RenderProcessHost* TabContents::GetRenderProcessHost() const {
return render_manager_.current_host()->process();
}
+bool TabContents::IsInstalledApp() const {
+ ExtensionsService* extension_service = profile()->GetExtensionsService();
+
+ // Check for hosted app.
+ if (extension_service->GetExtensionByWebExtent(GetURL()) != NULL)
+ return true;
+
+ // Check for packaged app.
+ const Extension* extension =
+ extension_service->GetExtensionById(GetURL().host(), false);
Erik does not do reviews 2010/12/02 01:05:17 use GetExtensionByURL instead (no need to use .hos
Charlie Reis 2010/12/02 01:45:43 Ah, nice. I should have noticed that one.
+ return extension != NULL && extension->is_app();
+}
+
void TabContents::SetExtensionApp(const Extension* extension) {
DCHECK(!extension || extension->GetFullLaunchURL().is_valid());
extension_app_ = extension;

Powered by Google App Engine
This is Rietveld 408576698