Commit 22ead103 authored by koz@chromium.org's avatar koz@chromium.org

Fix launching crashed apps from the command line while Chrome is running.

BUG=341820

Review URL: https://codereview.chromium.org/169303002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251925 0039d316-1c4b-4281-b951-d872f2087c98
parent 6ef01ac5
......@@ -482,7 +482,8 @@ void OpenApplicationWithReenablePrompt(const AppLaunchParams& params) {
ExtensionService* service =
extensions::ExtensionSystem::Get(profile)->extension_service();
if (!service->IsExtensionEnabled(extension->id())) {
if (!service->IsExtensionEnabled(extension->id()) ||
service->GetTerminatedExtension(extension->id())) {
(new EnableViaAppListFlow(
service, profile, params.desktop_type, extension->id(),
base::Bind(base::IgnoreResult(OpenEnabledApplication), params)))->Run();
......
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment