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

Unified Diff: extensions/common/manifest_handler_helpers.cc

Issue 1504453002: Allow arbitrary sizes for extension icons (and bookmark app icons) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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: extensions/common/manifest_handler_helpers.cc
diff --git a/extensions/common/manifest_handler_helpers.cc b/extensions/common/manifest_handler_helpers.cc
index 7186321009c1b4f3ce07f8ac8e0045702627e15d..4dc2f6b0837f204a39a30ca28eef5d691f556714 100644
--- a/extensions/common/manifest_handler_helpers.cc
+++ b/extensions/common/manifest_handler_helpers.cc
@@ -32,37 +32,10 @@ bool NormalizeAndValidatePath(std::string* path) {
}
bool LoadIconsFromDictionary(const base::DictionaryValue* icons_value,
- const int* icon_sizes,
- size_t num_icon_sizes,
ExtensionIconSet* icons,
base::string16* error) {
DCHECK(icons);
- for (size_t i = 0; i < num_icon_sizes; ++i) {
- std::string key = base::IntToString(icon_sizes[i]);
- if (icons_value->HasKey(key)) {
- std::string icon_path;
- if (!icons_value->GetString(key, &icon_path)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidIconPath, key);
- return false;
- }
-
- if (!NormalizeAndValidatePath(&icon_path)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidIconPath, key);
- return false;
- }
-
- icons->Add(icon_sizes[i], icon_path);
- }
- }
- return true;
-}
-
-bool LoadAllIconsFromDictionary(const base::DictionaryValue* icons_value,
- ExtensionIconSet* icons,
- base::string16* error) {
- DCHECK(icons);
+ DCHECK(error);
for (base::DictionaryValue::Iterator iterator(*icons_value);
!iterator.IsAtEnd(); iterator.Advance()) {
int size = 0;

Powered by Google App Engine
This is Rietveld 408576698