Chromium Code Reviews| 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; |