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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 169303002: Fix launching crashed apps from the command line while Chrome is running. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | « chrome/browser/ui/extensions/application_launch.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « chrome/browser/ui/extensions/application_launch.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698