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

Unified Diff: chrome/browser/ui/extensions/application_launch.cc

Issue 265503003: Enable file_handlers and chrome.app.runtime for QuickOffice. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
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();
+}

Powered by Google App Engine
This is Rietveld 408576698