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

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: 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_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..7fa20a995ec3ea9f12222dc08998fecc210a1893 100644
--- a/chrome/common/extensions/extension_icon_set.h
+++ b/chrome/common/extensions/extension_icon_set.h
@@ -11,19 +11,6 @@
// 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 {
- EXTENSION_ICON_GIGANTOR = 512,
- EXTENSION_ICON_EXTRA_LARGE = 256,
- EXTENSION_ICON_LARGE = 128,
- EXTENSION_ICON_MEDIUM = 48,
- EXTENSION_ICON_SMALL = 32,
- EXTENSION_ICON_SMALLISH = 24,
- EXTENSION_ICON_BITTY = 16,
- EXTENSION_ICON_INVALID = 0,
- };
-
// Get an icon from the set, optionally falling back to a smaller or bigger
// size. MatchType is exclusive (do not OR them together).
enum MatchType {
@@ -32,12 +19,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 +30,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