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

Unified Diff: chrome/browser/extensions/installed_loader.cc

Issue 10689097: Enforce the 'requirements' field in manifests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Conforming to the doc Created 8 years, 5 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/extensions/installed_loader.cc
diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc
index 83617a4f333fbe3b8a2c0f78b0f220bc48eca505..63324cdf2635b1df027003c3d50cfb6cc8ef7be0 100644
--- a/chrome/browser/extensions/installed_loader.cc
+++ b/chrome/browser/extensions/installed_loader.cc
@@ -76,6 +76,19 @@ void InstalledLoader::Load(const ExtensionInfo& info, bool write_to_prefs) {
*info.extension_manifest,
GetCreationFlags(&info),
&error);
+ if (extension_prefs_->HasUnsupportedRequirements(extension->id())) {
+ std::vector<std::string> requirement_errors =
+ extension_prefs_->GetUnsupportedRequirements(extension->id());
+ extensions::Extension::InstallWarningVector install_warnings;
+ std::vector<std::string>::iterator it;
+ for (it = requirement_errors.begin(); it != requirement_errors.end();
+ ++it) {
+ install_warnings.push_back(Extension::InstallWarning(
+ Extension::InstallWarning::FORMAT_TEXT, *it));
+ }
+ const_cast<Extension*>(extension.get())->AddInstallWarnings(
+ install_warnings);
+ }
} else {
error = errors::kManifestUnreadable;
}

Powered by Google App Engine
This is Rietveld 408576698