| Index: chrome/common/extensions/extension.cc
|
| diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
|
| index 7a200106c8f342c6dea99c52c14bd024318777b3..34b38d9e2f3d40f0ed92eac313ac3cb724f35905 100644
|
| --- a/chrome/common/extensions/extension.cc
|
| +++ b/chrome/common/extensions/extension.cc
|
| @@ -186,14 +186,6 @@ const int Extension::kValidHostPermissionSchemes = URLPattern::SCHEME_CHROMEUI |
|
| URLPattern::SCHEME_FILE |
|
| URLPattern::SCHEME_FTP;
|
|
|
| -Extension::Requirements::Requirements()
|
| - : webgl(false),
|
| - css3d(false),
|
| - npapi(false) {
|
| -}
|
| -
|
| -Extension::Requirements::~Requirements() {}
|
| -
|
| //
|
| // Extension
|
| //
|
| @@ -1663,7 +1655,6 @@ bool Extension::LoadSharedFeatures(string16* error) {
|
| !ManifestHandler::ParseExtension(this, error) ||
|
| !LoadNaClModules(error) ||
|
| !LoadSandboxedPages(error) ||
|
| - !LoadRequirements(error) ||
|
| !LoadKioskEnabled(error) ||
|
| !LoadOfflineEnabled(error))
|
| return false;
|
| @@ -1798,82 +1789,6 @@ bool Extension::LoadSandboxedPages(string16* error) {
|
| return true;
|
| }
|
|
|
| -bool Extension::LoadRequirements(string16* error) {
|
| - // Before parsing requirements from the manifest, automatically default the
|
| - // NPAPI plugin requirement based on whether it includes NPAPI plugins.
|
| - const ListValue* list_value = NULL;
|
| - requirements_.npapi =
|
| - manifest_->GetList(keys::kPlugins, &list_value) && !list_value->empty();
|
| -
|
| - if (!manifest_->HasKey(keys::kRequirements))
|
| - return true;
|
| -
|
| - const DictionaryValue* requirements_value = NULL;
|
| - if (!manifest_->GetDictionary(keys::kRequirements, &requirements_value)) {
|
| - *error = ASCIIToUTF16(errors::kInvalidRequirements);
|
| - return false;
|
| - }
|
| -
|
| - for (DictionaryValue::Iterator it(*requirements_value); !it.IsAtEnd();
|
| - it.Advance()) {
|
| - const DictionaryValue* requirement_value;
|
| - if (!it.value().GetAsDictionary(&requirement_value)) {
|
| - *error = ErrorUtils::FormatErrorMessageUTF16(
|
| - errors::kInvalidRequirement, it.key());
|
| - return false;
|
| - }
|
| -
|
| - if (it.key() == "plugins") {
|
| - for (DictionaryValue::Iterator plugin_it(*requirement_value);
|
| - !plugin_it.IsAtEnd(); plugin_it.Advance()) {
|
| - bool plugin_required = false;
|
| - if (!plugin_it.value().GetAsBoolean(&plugin_required)) {
|
| - *error = ErrorUtils::FormatErrorMessageUTF16(
|
| - errors::kInvalidRequirement, it.key());
|
| - return false;
|
| - }
|
| - if (plugin_it.key() == "npapi") {
|
| - requirements_.npapi = plugin_required;
|
| - } else {
|
| - *error = ErrorUtils::FormatErrorMessageUTF16(
|
| - errors::kInvalidRequirement, it.key());
|
| - return false;
|
| - }
|
| - }
|
| - } else if (it.key() == "3D") {
|
| - const ListValue* features = NULL;
|
| - if (!requirement_value->GetListWithoutPathExpansion("features",
|
| - &features) ||
|
| - !features) {
|
| - *error = ErrorUtils::FormatErrorMessageUTF16(
|
| - errors::kInvalidRequirement, it.key());
|
| - return false;
|
| - }
|
| -
|
| - for (base::ListValue::const_iterator feature_it = features->begin();
|
| - feature_it != features->end();
|
| - ++feature_it) {
|
| - std::string feature;
|
| - if ((*feature_it)->GetAsString(&feature)) {
|
| - if (feature == "webgl") {
|
| - requirements_.webgl = true;
|
| - } else if (feature == "css3d") {
|
| - requirements_.css3d = true;
|
| - } else {
|
| - *error = ErrorUtils::FormatErrorMessageUTF16(
|
| - errors::kInvalidRequirement, it.key());
|
| - return false;
|
| - }
|
| - }
|
| - }
|
| - } else {
|
| - *error = ASCIIToUTF16(errors::kInvalidRequirements);
|
| - return false;
|
| - }
|
| - }
|
| - return true;
|
| -}
|
| -
|
| bool Extension::LoadKioskEnabled(string16* error) {
|
| if (!manifest_->HasKey(keys::kKioskEnabled))
|
| return true;
|
|
|