summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_action.h
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 21:08:30 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-19 21:08:30 +0000
commit0f5a3da9fbc074bbb9c63163866ba5d806919d0d (patch)
tree17520be691546c964cfe7a4d2aa1afbeb07be5fb /chrome/common/extensions/extension_action.h
parent8b37ca19491d189fe6db3ca9a5a124722373f94e (diff)
downloadchromium_src-0f5a3da9fbc074bbb9c63163866ba5d806919d0d.zip
chromium_src-0f5a3da9fbc074bbb9c63163866ba5d806919d0d.tar.gz
chromium_src-0f5a3da9fbc074bbb9c63163866ba5d806919d0d.tar.bz2
Implement badges for page actions. Also add badge text color API.
Also change color APIs from wanting ARGB to RGBA. BUG=24635 BUG=24644 BUG=25215 Review URL: http://codereview.chromium.org/291003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_action.h')
-rw-r--r--chrome/common/extensions/extension_action.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/common/extensions/extension_action.h b/chrome/common/extensions/extension_action.h
index 6decdd4..b819edb 100644
--- a/chrome/common/extensions/extension_action.h
+++ b/chrome/common/extensions/extension_action.h
@@ -84,7 +84,8 @@ class ExtensionActionState {
public:
ExtensionActionState(std::string title, int icon_index)
: hidden_(false), title_(title), icon_index_(icon_index),
- badge_background_color_(SkColorSetARGB(255, 218, 0, 24)) {
+ badge_background_color_(SkColorSetARGB(255, 218, 0, 24)),
+ badge_text_color_(SK_ColorWHITE) {
}
const std::string& title() const { return title_; }
@@ -102,6 +103,13 @@ class ExtensionActionState {
badge_background_color_ = badge_background_color;
}
+ SkColor badge_text_color() const {
+ return badge_text_color_;
+ }
+ void set_badge_text_color(SkColor badge_text_color) {
+ badge_text_color_ = badge_text_color;
+ }
+
int icon_index() const { return icon_index_; }
void set_icon_index(int icon_index) { icon_index_ = icon_index; }
@@ -111,7 +119,7 @@ class ExtensionActionState {
bool hidden() const { return hidden_; }
void set_hidden(bool hidden) { hidden_ = hidden; }
- void PaintBadge(gfx::Canvas* canvas, const gfx::Rect& bounds);
+ void PaintBadge(gfx::Canvas* canvas, const gfx::Rect& bounds) const;
private:
// True if the action is in the hidden state.
@@ -132,6 +140,9 @@ class ExtensionActionState {
// The background color for the badge.
SkColor badge_background_color_;
+ // The text color for the badge.
+ SkColor badge_text_color_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionActionState);
};