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

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: Feedback, less hacky Created 6 years, 7 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 f5b8f1617f4b1936b8f1b9201978b087450ef2a3..23f01b962dc6fec20f65d65ec1826c27679ff3ee 100644
--- a/chrome/browser/ui/extensions/application_launch.cc
+++ b/chrome/browser/ui/extensions/application_launch.cc
@@ -39,6 +39,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"
@@ -322,7 +324,7 @@ WebContents* OpenEnabledApplication(const AppLaunchParams& params) {
UMA_HISTOGRAM_ENUMERATION(
"Extensions.AppLaunchContainer", params.container, 100);
- if (extension->is_platform_app()) {
+ if (CanLaunchViaEvent(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)->
@@ -466,3 +468,10 @@ WebContents* OpenAppShortcutWindow(Profile* profile,
return tab;
}
+
+bool CanLaunchViaEvent(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();
+}
« no previous file with comments | « chrome/browser/ui/extensions/application_launch.h ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698