Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc |
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
index 926f8e42daa11eb86b07bcd42d40368cb52366b2..6f794fd2dedfad23e73a3a328f9551e03505d757 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
@@ -305,11 +305,13 @@ class WebContentsCloseObserver : public content::NotificationObserver { |
DISALLOW_COPY_AND_ASSIGN(WebContentsCloseObserver); |
}; |
-const Extension* GetDisabledPlatformApp(Profile* profile, |
+const Extension* GetDisabledOrTerminatedPlatformApp(Profile* profile, |
const std::string& extension_id) { |
ExtensionService* service = |
extensions::ExtensionSystem::Get(profile)->extension_service(); |
const Extension* extension = service->GetExtensionById(extension_id, true); |
+ if (!extension) |
+ extension = service->GetTerminatedExtension(extension_id); |
return extension && extension->is_platform_app() ? extension : NULL; |
} |
@@ -367,9 +369,10 @@ bool StartupBrowserCreatorImpl::Launch(Profile* profile, |
AppListService::InitAll(profile); |
if (command_line_.HasSwitch(switches::kAppId)) { |
std::string app_id = command_line_.GetSwitchValueASCII(switches::kAppId); |
- const Extension* extension = GetDisabledPlatformApp(profile, app_id); |
- // If |app_id| is a disabled platform app we handle it specially here, |
- // otherwise it will be handled below. |
+ const Extension* extension = |
+ GetDisabledOrTerminatedPlatformApp(profile, app_id); |
+ // If |app_id| is a disabled or terminated platform app we handle it |
+ // specially here, otherwise it will be handled below. |
if (extension) { |
RecordCmdLineAppHistogram(extensions::Manifest::TYPE_PLATFORM_APP); |
AppLaunchParams params(profile, extension, |