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

Unified Diff: chrome/common/extensions/extension.cc

Issue 10843014: Generalize ExtensionIconSet to store icon paths for custom size sets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 months 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 | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 48555a42a254cf14694a09e55c664014df5f2782..aeda254063492cb5906fdddb529f9eca4ec454d4 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1421,8 +1421,9 @@ bool Extension::LoadIcons(string16* error) {
return false;
}
- for (size_t i = 0; i < ExtensionIconSet::kNumIconSizes; ++i) {
- std::string key = base::IntToString(ExtensionIconSet::kIconSizes[i]);
+ for (size_t i = 0; i < extension_misc::kNumExtensionIconSizes; ++i) {
+ std::string key =
+ base::IntToString(extension_misc::kExtensionIconSizes[i]);
if (icons_value->HasKey(key)) {
std::string icon_path;
if (!icons_value->GetString(key, &icon_path)) {
@@ -1439,7 +1440,7 @@ bool Extension::LoadIcons(string16* error) {
errors::kInvalidIconPath, key);
return false;
}
- icons_.Add(ExtensionIconSet::kIconSizes[i], icon_path);
+ icons_.Add(extension_misc::kExtensionIconSizes[i], icon_path);
}
}
return true;
@@ -2371,7 +2372,7 @@ bool Extension::LoadScriptBadge(string16* error) {
InstallWarning(InstallWarning::FORMAT_TEXT,
errors::kScriptBadgeIconIgnored));
}
- std::string icon16_path = icons().Get(ExtensionIconSet::EXTENSION_ICON_BITTY,
+ std::string icon16_path = icons().Get(extension_misc::EXTENSION_ICON_BITTY,
ExtensionIconSet::MATCH_EXACTLY);
if (!icon16_path.empty()) {
script_badge_->set_default_icon_path(icon16_path);
@@ -3014,25 +3015,25 @@ bool Extension::FormatPEMForFileOutput(const std::string& input,
// static
void Extension::DecodeIcon(const Extension* extension,
- ExtensionIconSet::Icons preferred_icon_size,
+ int preferred_icon_size,
ExtensionIconSet::MatchType match_type,
scoped_ptr<SkBitmap>* result) {
std::string path = extension->icons().Get(preferred_icon_size, match_type);
- ExtensionIconSet::Icons size = extension->icons().GetIconSizeFromPath(path);
+ int size = extension->icons().GetIconSizeFromPath(path);
ExtensionResource icon_resource = extension->GetResource(path);
DecodeIconFromPath(icon_resource.GetFilePath(), size, result);
}
// static
void Extension::DecodeIcon(const Extension* extension,
- ExtensionIconSet::Icons icon_size,
+ int icon_size,
scoped_ptr<SkBitmap>* result) {
DecodeIcon(extension, icon_size, ExtensionIconSet::MATCH_EXACTLY, result);
}
// static
void Extension::DecodeIconFromPath(const FilePath& icon_path,
- ExtensionIconSet::Icons icon_size,
+ int icon_size,
scoped_ptr<SkBitmap>* result) {
if (icon_path.empty())
return;
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698