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

Unified Diff: chrome/common/extensions/extension.cc

Issue 8429023: Add platform_app flag to manifest. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Merge conflict resolution. Created 9 years, 1 month 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/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index dbe72d1f7c0b95cefb24de479e5c5e998ffb1c6f..70bb789e2729d13f4e2ff85aed430936ea5b77e1 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -903,6 +903,12 @@ bool Extension::LoadIsApp(const DictionaryValue* manifest,
if (manifest->HasKey(keys::kApp))
is_app_ = true;
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnablePlatformApps)) {
+ if (manifest->HasKey(keys::kPlatformApp))
+ is_platform_app_ = true;
+ }
+
return true;
}
@@ -1275,6 +1281,7 @@ Extension::Extension(const FilePath& path, Location location)
converted_from_user_script_(false),
is_theme_(false),
is_app_(false),
+ is_platform_app_(false),
is_storage_isolated_(false),
launch_container_(extension_misc::LAUNCH_TAB),
launch_width_(0),
@@ -1515,6 +1522,13 @@ bool Extension::InitFromValue(const DictionaryValue& source, int flags,
return false;
}
+ if (is_platform_app_) {
+ if (launch_container() != extension_misc::LAUNCH_PANEL) {
+ *error = errors::kInvalidLaunchContainerForPlatform;
+ return false;
+ }
+ }
+
// Initialize the permissions (optional).
ExtensionAPIPermissionSet api_permissions;
URLPatternSet host_permissions;
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698