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

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

Issue 9705083: Unknown options in extension manifest file are silently ignored (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed unit test Created 8 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/common/extensions/manifest.cc
diff --git a/chrome/common/extensions/manifest.cc b/chrome/common/extensions/manifest.cc
index dc4c4bebe096b17c4f4a97ec08a2900ecd3ffb90..fa3658b0d3eaf760f065f813c4bc511dc5a44fa4 100644
--- a/chrome/common/extensions/manifest.cc
+++ b/chrome/common/extensions/manifest.cc
@@ -8,6 +8,7 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/string_split.h"
+#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/extension_error_utils.h"
@@ -77,6 +78,15 @@ void Manifest::ValidateManifest(std::string* error,
if (result != Feature::IS_AVAILABLE)
warnings->push_back(feature->GetErrorMessage(result));
}
+
+ // Also generate warnings for keys that are not features.
+ for (DictionaryValue::key_iterator key = value_->begin_keys();
+ key != value_->end_keys(); ++key) {
+ if (!SimpleFeatureProvider::GetManifestFeatures()->GetFeature(*key)) {
+ warnings->push_back(base::StringPrintf("Unrecognized manifest key '%s'.",
+ (*key).c_str()));
+ }
+ }
}
bool Manifest::HasKey(const std::string& key) const {
« no previous file with comments | « chrome/browser/webdata/web_database_migration_unittest.cc ('k') | chrome/common/extensions/manifest_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698