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

Unified Diff: extensions/common/manifest_handler_helpers.cc

Issue 1492073003: Handle more scale factors for extension Browser Action icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test catches real bug! 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
« no previous file with comments | « extensions/common/manifest_handler_helpers.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/manifest_handler_helpers.cc
diff --git a/extensions/common/manifest_handler_helpers.cc b/extensions/common/manifest_handler_helpers.cc
index d3dfea6199c4cc0c4754f9ba5afdaedb85791b16..7186321009c1b4f3ce07f8ac8e0045702627e15d 100644
--- a/extensions/common/manifest_handler_helpers.cc
+++ b/extensions/common/manifest_handler_helpers.cc
@@ -59,6 +59,27 @@ bool LoadIconsFromDictionary(const base::DictionaryValue* icons_value,
return true;
}
+bool LoadAllIconsFromDictionary(const base::DictionaryValue* icons_value,
+ ExtensionIconSet* icons,
+ base::string16* error) {
+ DCHECK(icons);
+ for (base::DictionaryValue::Iterator iterator(*icons_value);
+ !iterator.IsAtEnd(); iterator.Advance()) {
+ int size = 0;
+ std::string icon_path;
+ if (!base::StringToInt(iterator.key(), &size) ||
+ !iterator.value().GetAsString(&icon_path) ||
+ !NormalizeAndValidatePath(&icon_path)) {
+ *error = ErrorUtils::FormatErrorMessageUTF16(errors::kInvalidIconPath,
+ iterator.key());
+ return false;
+ }
+
+ icons->Add(size, icon_path);
+ }
+ return true;
+}
+
} // namespace manifest_handler_helpers
} // namespace extensions
« no previous file with comments | « extensions/common/manifest_handler_helpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698