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

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

Issue 10536084: Add a warning when developing an extension that uses old manifest version. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blonk 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 f7bcbab672690451cc8272925e6ced29c14898da..2a767b505b4f4cdea7158f0098793e3745b051f9 100644
--- a/chrome/common/extensions/manifest.cc
+++ b/chrome/common/extensions/manifest.cc
@@ -44,8 +44,9 @@ Manifest::Manifest(Extension::Location location,
Manifest::~Manifest() {
}
-void Manifest::ValidateManifest(std::string* error,
- std::vector<std::string>* warnings) const {
+void Manifest::ValidateManifest(
+ std::string* error,
+ Extension::InstallWarningVector* warnings) const {
*error = "";
if (type_ == Extension::TYPE_PLATFORM_APP && GetManifestVersion() < 2) {
*error = errors::kPlatformAppNeedsManifestVersion2;
@@ -72,15 +73,19 @@ void Manifest::ValidateManifest(std::string* error,
extension_id_, type_, Feature::ConvertLocation(location_),
GetManifestVersion());
if (result != Feature::IS_AVAILABLE)
- warnings->push_back(feature->GetErrorMessage(result));
+ warnings->push_back(Extension::InstallWarning(
+ Extension::InstallWarning::FORMAT_TEXT,
+ 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()));
+ warnings->push_back(Extension::InstallWarning(
+ Extension::InstallWarning::FORMAT_TEXT,
+ base::StringPrintf("Unrecognized manifest key '%s'.",
+ (*key).c_str())));
}
}
}
« no previous file with comments | « chrome/common/extensions/manifest.h ('k') | chrome/common/extensions/manifest_tests/extension_manifest_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698