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

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

Issue 10914244: Remove support for page_action.icons, and the legacy code surrounding it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: constants removed Created 8 years, 3 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.cc ('k') | chrome/common/extensions/extension_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_action.h
diff --git a/chrome/common/extensions/extension_action.h b/chrome/common/extensions/extension_action.h
index 5a655ff69159738a984a27573159aa634a43c14e..b5a13392509308a7f493abdff4adc7cd468ecae7 100644
--- a/chrome/common/extensions/extension_action.h
+++ b/chrome/common/extensions/extension_action.h
@@ -133,10 +133,6 @@ class ExtensionAction {
std::string id() const { return id_; }
void set_id(const std::string& id) { id_ = id; }
- // static icon paths from manifest -- only used with legacy page actions API.
- std::vector<std::string>* icon_paths() { return &icon_paths_; }
- const std::vector<std::string>* icon_paths() const { return &icon_paths_; }
-
bool has_changed() const { return has_changed_; }
void set_has_changed(bool value) { has_changed_ = value; }
@@ -164,13 +160,11 @@ class ExtensionAction {
// Setting the default icon using a path clears the bitmap and vice-versa.
// Since ExtensionAction, living in common/, can't interact with the browser
- // to load images, the UI code needs to load the images for each path. For
- // each path in default_icon_path() and icon_paths(), load the image there
- // using an ImageLoadingTracker and call CacheIcon(path, image) with the
- // result.
+ // to load images, the UI code needs to load the icon. Load the image there
+ // using an ImageLoadingTracker and call CacheIcon(image) with the result.
//
// If an image is cached redundantly, the first load will be used.
- void CacheIcon(const std::string& path, const gfx::Image& icon);
+ void CacheIcon(const gfx::Image& icon);
// Set this action's icon bitmap on a specific tab.
void SetIcon(int tab_id, const gfx::Image& image);
@@ -184,16 +178,6 @@ class ExtensionAction {
// Gets the icon that has been set using |SetIcon| for the tab.
gfx::ImageSkia GetExplicitlySetIcon(int tab_id) const;
- // Set this action's icon index for a specific tab. For use with
- // icon_paths(), only used in page actions.
- void SetIconIndex(int tab_id, int index);
-
- // Get this action's icon index for a tab, or the default if no icon index
- // was set.
- int GetIconIndex(int tab_id) const {
- return GetValue(&icon_index_, tab_id);
- }
-
// Non-tab-specific icon path. This is used to support the default_icon key of
// page and browser actions.
void set_default_icon_path(const std::string& path) {
@@ -310,7 +294,6 @@ class ExtensionAction {
std::map<int, GURL> popup_url_;
std::map<int, std::string> title_;
std::map<int, gfx::ImageSkia> icon_;
- std::map<int, int> icon_index_; // index into icon_paths_
std::map<int, std::string> badge_text_;
std::map<int, SkColor> badge_background_color_;
std::map<int, SkColor> badge_text_color_;
@@ -329,12 +312,8 @@ class ExtensionAction {
// needed for compat with an older version of the page actions API.
std::string id_;
- // A list of paths to icons this action might show. This is needed to support
- // the legacy setIcon({iconIndex:...} method of the page actions API.
- std::vector<std::string> icon_paths_;
-
// Saves the arguments from CacheIcon() calls.
- std::map<std::string, gfx::ImageSkia> path_to_icon_cache_;
+ scoped_ptr<gfx::ImageSkia> cached_icon_;
// True if the ExtensionAction's settings have changed from what was
// specified in the manifest.
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698