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

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

Issue 10544059: Change the platform app manifest structure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update for getDisplayPath, implement restrictions via _manifest_features.json Created 8 years, 6 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/common/extensions/manifest.cc
diff --git a/chrome/common/extensions/manifest.cc b/chrome/common/extensions/manifest.cc
index fa3658b0d3eaf760f065f813c4bc511dc5a44fa4..f7bcbab672690451cc8272925e6ced29c14898da 100644
--- a/chrome/common/extensions/manifest.cc
+++ b/chrome/common/extensions/manifest.cc
@@ -26,21 +26,17 @@ Manifest::Manifest(Extension::Location location,
type_(Extension::TYPE_UNKNOWN) {
if (value_->HasKey(keys::kTheme)) {
type_ = Extension::TYPE_THEME;
- } else {
- bool is_platform_app = false;
- if (value_->GetBoolean(keys::kPlatformApp, &is_platform_app) &&
- is_platform_app) {
+ } else if (value_->HasKey(keys::kApp)) {
+ if (value_->Get(keys::kWebURLs, NULL) ||
+ value_->Get(keys::kLaunchWebURL, NULL)) {
+ type_ = Extension::TYPE_HOSTED_APP;
+ } else if (value_->Get(keys::kPlatformAppBackground, NULL)) {
type_ = Extension::TYPE_PLATFORM_APP;
- } else if (value_->HasKey(keys::kApp)) {
- if (value_->Get(keys::kWebURLs, NULL) ||
- value_->Get(keys::kLaunchWebURL, NULL)) {
- type_ = Extension::TYPE_HOSTED_APP;
- } else {
- type_ = Extension::TYPE_PACKAGED_APP;
- }
} else {
- type_ = Extension::TYPE_EXTENSION;
+ type_ = Extension::TYPE_PACKAGED_APP;
}
+ } else {
+ type_ = Extension::TYPE_EXTENSION;
}
CHECK_NE(type_, Extension::TYPE_UNKNOWN);
}
@@ -93,6 +89,11 @@ bool Manifest::HasKey(const std::string& key) const {
return CanAccessKey(key) && value_->HasKey(key);
}
+bool Manifest::HasPath(const std::string& path) const {
+ Value* ignored = NULL;
+ return CanAccessPath(path) && value_->Get(path, &ignored);
+}
+
bool Manifest::Get(
const std::string& path, Value** out_value) const {
return CanAccessPath(path) && value_->Get(path, out_value);
« no previous file with comments | « chrome/common/extensions/manifest.h ('k') | chrome/common/extensions/manifest_tests/extension_manifest_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698