Index: chrome/browser/ui/extensions/application_launch.cc |
diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc |
index b96c1ab60aaab7ed92349713686dd7da32860628..c57d2078bc725f49a362f2ad5c36b33c70839cbf 100644 |
--- a/chrome/browser/ui/extensions/application_launch.cc |
+++ b/chrome/browser/ui/extensions/application_launch.cc |
@@ -40,6 +40,8 @@ |
#include "extensions/browser/extension_system.h" |
#include "extensions/common/constants.h" |
#include "extensions/common/extension.h" |
+#include "extensions/common/features/feature.h" |
+#include "extensions/common/features/feature_provider.h" |
#include "grit/generated_resources.h" |
#include "ui/base/window_open_disposition.h" |
#include "ui/gfx/rect.h" |
@@ -323,7 +325,7 @@ WebContents* OpenEnabledApplication(const AppLaunchParams& params) { |
UMA_HISTOGRAM_ENUMERATION( |
"Extensions.AppLaunchContainer", params.container, 100); |
- if (extension->is_platform_app()) { |
+ if (LaunchesViaEvent(extension)) { |
// Remember what desktop the launch happened on so that when the app opens a |
// window we can open them on the right desktop. |
PerAppSettingsServiceFactory::GetForBrowserContext(profile)-> |
@@ -467,3 +469,10 @@ WebContents* OpenAppShortcutWindow(Profile* profile, |
return tab; |
} |
+ |
+bool LaunchesViaEvent(const extensions::Extension* extension) { |
+ extensions::FeatureProvider* feature_provider = |
+ extensions::FeatureProvider::GetAPIFeatures(); |
+ extensions::Feature* feature = feature_provider->GetFeature("app.runtime"); |
+ return feature->IsAvailableToExtension(extension).is_available(); |
+} |