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

Unified Diff: chrome/common/extensions/extension_icon_set.h

Issue 10843014: Generalize ExtensionIconSet to store icon paths for custom size sets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: .. 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_constants.cc ('k') | chrome/common/extensions/extension_icon_set.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_icon_set.h
diff --git a/chrome/common/extensions/extension_icon_set.h b/chrome/common/extensions/extension_icon_set.h
index dc58813f27f03bda7afe3ab37e676276fe334fe7..a9f515205478bdbc4e31f5213bd8570662b77300 100644
--- a/chrome/common/extensions/extension_icon_set.h
+++ b/chrome/common/extensions/extension_icon_set.h
@@ -11,9 +11,9 @@
// Represents the set of icons for an extension.
class ExtensionIconSet {
public:
- // NOTE: If you change this list, you should also change kIconSizes in the cc
- // file.
- enum Icons {
+ // NOTE: If you change this list, you should also change kExtensionIconSizes
+ // in extension_constants.cc.
+ enum ExtensionIcons {
Aaron Boodman 2012/08/13 23:33:25 Can you move this enum to extension_constants, too
tbarzic 2012/08/14 18:06:57 Done.
EXTENSION_ICON_GIGANTOR = 512,
EXTENSION_ICON_EXTRA_LARGE = 256,
EXTENSION_ICON_LARGE = 128,
@@ -32,12 +32,8 @@ class ExtensionIconSet {
MATCH_SMALLER
};
- // Access to the underlying map from icon size->path.
- typedef std::map<Icons, std::string> IconMap;
-
- // Icon sizes used by the extension system.
- static const Icons kIconSizes[];
- static const size_t kNumIconSizes;
+ // Access to the underlying map from icon size->{path, bitmap}.
+ typedef std::map<int, std::string> IconMap;
ExtensionIconSet();
~ExtensionIconSet();
@@ -47,17 +43,19 @@ class ExtensionIconSet {
// Remove all icons from the set.
void Clear();
- // Add an icon to the set. If the specified size is already present, it is
- // overwritten.
- void Add(Icons size, const std::string& path);
+ // Add an icon path to the set. If a path for the specified size is already
+ // present, it is overwritten.
+ void Add(int size, const std::string& path);
+ // Gets path value of the icon found when searching for |size| using
+ // |mathc_type|.
std::string Get(int size, MatchType match_type) const;
- // Returns true if the set contains the specified path.
+ // Returns true iff the set contains the specified path.
bool ContainsPath(const std::string& path) const;
// Returns icon size if the set contains the specified path or 0 if not found.
- Icons GetIconSizeFromPath(const std::string& path) const;
+ int GetIconSizeFromPath(const std::string& path) const;
private:
IconMap map_;
« no previous file with comments | « chrome/common/extensions/extension_constants.cc ('k') | chrome/common/extensions/extension_icon_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698