summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-18 09:36:17 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-18 09:36:17 +0000
commit50c4e907cf41e395a5edecd1ae122b9a2b35410d (patch)
treecc1f180f8245419344ad67c759e1164e48a029ef /chrome
parent91733b650d1e31b84a50860b3e5780d97b11d86d (diff)
downloadchromium_src-50c4e907cf41e395a5edecd1ae122b9a2b35410d.zip
chromium_src-50c4e907cf41e395a5edecd1ae122b9a2b35410d.tar.gz
chromium_src-50c4e907cf41e395a5edecd1ae122b9a2b35410d.tar.bz2
Fix bug where we fail to install an extension that has an empty
permissions array in its manifest. This was caused an old attempt to display a warning in this situation, back when we were ambitious. BUG=22157 TEST=Install extension associated with bug. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=26534 Review URL: http://codereview.chromium.org/213009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/extensions/extension.cc5
-rw-r--r--chrome/common/extensions/extension_constants.cc2
-rw-r--r--chrome/common/extensions/extension_constants.h1
-rw-r--r--chrome/common/extensions/extension_unittest.cc6
4 files changed, 1 insertions, 13 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 2566d41..cd2a8c7 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -947,11 +947,6 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_id,
return false;
}
- if (permissions->GetSize() == 0) {
- ExtensionErrorReporter::GetInstance()->ReportError(
- errors::kInvalidPermissionCountWarning, false);
- }
-
for (size_t i = 0; i < permissions->GetSize(); ++i) {
std::string permission_str;
if (!permissions->GetString(i, &permission_str)) {
diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc
index d72fbcf..0ae5ff5 100644
--- a/chrome/common/extensions/extension_constants.cc
+++ b/chrome/common/extensions/extension_constants.cc
@@ -100,8 +100,6 @@ const char* kInvalidPageActionTypeValue =
"Invalid value for 'page_actions[*].type', expected 'tab' or 'permanent'.";
const char* kInvalidPermissions =
"Required value 'permissions' is missing or invalid.";
-const char* kInvalidPermissionCountWarning =
- "Warning, 'permissions' key found, but array is empty.";
const char* kInvalidPermission =
"Invalid value for 'permissions[*]'.";
const char* kInvalidPermissionScheme =
diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h
index 09429a2..399315e8 100644
--- a/chrome/common/extensions/extension_constants.h
+++ b/chrome/common/extensions/extension_constants.h
@@ -87,7 +87,6 @@ namespace extension_manifest_errors {
extern const char* kInvalidPageActionId;
extern const char* kInvalidPageActionTypeValue;
extern const char* kInvalidPermissions;
- extern const char* kInvalidPermissionCountWarning;
extern const char* kInvalidPermission;
extern const char* kInvalidPermissionScheme;
extern const char* kInvalidZipHash;
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index fb40330..564ef0c 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -182,11 +182,7 @@ TEST(ExtensionTest, InitFromValueInvalid) {
permissions = new ListValue;
input_value->Set(keys::kPermissions, permissions);
EXPECT_TRUE(extension.InitFromValue(*input_value, true, &error));
- const std::vector<std::string>* error_vector =
- ExtensionErrorReporter::GetInstance()->GetErrors();
- const std::string log_error = error_vector->at(error_vector->size() - 1);
- EXPECT_TRUE(MatchPattern(log_error,
- errors::kInvalidPermissionCountWarning));
+ EXPECT_EQ(0u, ExtensionErrorReporter::GetInstance()->GetErrors()->size());
input_value->Set(keys::kPermissions, Value::CreateIntegerValue(9));
EXPECT_FALSE(extension.InitFromValue(*input_value, true, &error));