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

Unified Diff: chrome/common/page_action.h

Issue 149046: PageActions can now specify multiple icons and switch between them... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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/renderer/renderer_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/page_action.h
===================================================================
--- chrome/common/page_action.h (revision 19579)
+++ chrome/common/page_action.h (working copy)
@@ -5,8 +5,9 @@
#ifndef CHROME_COMMON_PAGE_ACTION_H_
#define CHROME_COMMON_PAGE_ACTION_H_
+#include <map>
#include <string>
-#include <map>
+#include <vector>
#include "base/file_path.h"
@@ -34,9 +35,9 @@
std::string name() const { return name_; }
void set_name(const std::string& name) { name_ = name; }
- FilePath icon_path() const { return icon_path_; }
- void set_icon_path(const FilePath& icon_path) {
- icon_path_ = icon_path;
+ const std::vector<FilePath>& icon_paths() const { return icon_paths_; }
+ void AddIconPath(const FilePath& icon_path) {
+ icon_paths_.push_back(icon_path);
}
private:
@@ -53,10 +54,31 @@
// The name of the PageAction.
std::string name_;
- // The icon that represents the PageIcon.
- FilePath icon_path_;
+ // The paths to the icons that this PageIcon can show.
+ std::vector<FilePath> icon_paths_;
};
typedef std::map<std::string, PageAction*> PageActionMap;
+// This class keeps track of what values each tab uses to override the default
+// values of the PageAction.
+class PageActionState {
+ public:
+ PageActionState(std::string title, int icon_index)
+ : title_(title), icon_index_(icon_index) {
+ }
+
+ std::string title() const { return title_; }
+ int icon_index() const { return icon_index_; }
+
+ private:
+ // The title to use.
+ std::string title_;
+
+ // The icon to use.
+ int icon_index_;
+
+ DISALLOW_COPY_AND_ASSIGN(PageActionState);
+};
+
#endif // CHROME_COMMON_PAGE_ACTION_H_
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/renderer/renderer_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698