| Index: chrome/common/extensions/extension.cc
|
| ===================================================================
|
| --- chrome/common/extensions/extension.cc (revision 104911)
|
| +++ chrome/common/extensions/extension.cc (working copy)
|
| @@ -1175,7 +1175,9 @@
|
| *key != keys::kOptionalPermissions &&
|
| *key != keys::kOptionsPage &&
|
| *key != keys::kBackground &&
|
| - *key != keys::kOfflineEnabled) {
|
| + *key != keys::kOfflineEnabled &&
|
| + *key != keys::kMinimumChromeVersion &&
|
| + *key != keys::kRequirements) {
|
| *error = ExtensionErrorUtils::FormatErrorMessage(
|
| errors::kHostedAppsCannotIncludeExtensionFeatures, *key);
|
| return false;
|
| @@ -2299,6 +2301,27 @@
|
| }
|
| }
|
|
|
| + // Initialize requirements (optional). Not actually persisted (they're only
|
| + // used by the store), but still validated.
|
| + if (source.HasKey(keys::kRequirements)) {
|
| + DictionaryValue* requirements_value = NULL;
|
| + if (!source.GetDictionary(keys::kRequirements, &requirements_value)) {
|
| + *error = errors::kInvalidRequirements;
|
| + return false;
|
| + }
|
| +
|
| + for (DictionaryValue::key_iterator it = requirements_value->begin_keys();
|
| + it != requirements_value->end_keys(); ++it) {
|
| + DictionaryValue* requirement_value;
|
| + if (!requirements_value->GetDictionaryWithoutPathExpansion(
|
| + *it, &requirement_value)) {
|
| + *error = ExtensionErrorUtils::FormatErrorMessage(
|
| + errors::kInvalidRequirement, *it);
|
| + return false;
|
| + }
|
| + }
|
| + }
|
| +
|
| if (HasMultipleUISurfaces()) {
|
| *error = errors::kOneUISurfaceOnly;
|
| return false;
|
|
|