diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 19:39:24 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 19:39:24 +0000 |
commit | 5132483c2e2775f0e6bcc249e1438cf88dac97a2 (patch) | |
tree | efa309ebfc998bec325fcfafa0663ec53982ae58 /chrome/common/extensions/extension_action.h | |
parent | e8bce8f868f0ffbd8d608461eb938ee4cc4c0020 (diff) | |
download | chromium_src-5132483c2e2775f0e6bcc249e1438cf88dac97a2.zip chromium_src-5132483c2e2775f0e6bcc249e1438cf88dac97a2.tar.gz chromium_src-5132483c2e2775f0e6bcc249e1438cf88dac97a2.tar.bz2 |
Add an API to manipulate the browser action badge.
BUG=23268
Review URL: http://codereview.chromium.org/256032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27951 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_action.h')
-rw-r--r-- | chrome/common/extensions/extension_action.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/chrome/common/extensions/extension_action.h b/chrome/common/extensions/extension_action.h index 630671c..70ea093 100644 --- a/chrome/common/extensions/extension_action.h +++ b/chrome/common/extensions/extension_action.h @@ -10,7 +10,9 @@ #include <vector> #include "base/basictypes.h" +#include "base/scoped_ptr.h" #include "googleurl/src/gurl.h" +#include "third_party/skia/include/core/SkColor.h" class ExtensionAction { public: @@ -85,12 +87,25 @@ typedef std::map<std::string, ExtensionAction*> ExtensionActionMap; class ExtensionActionState { public: ExtensionActionState(std::string title, int icon_index) - : title_(title), icon_index_(icon_index) { + : title_(title), icon_index_(icon_index), + badge_background_color_(new SkColor(SkColorSetARGB(255, 218, 0, 24))) { } - std::string title() const { return title_; } + const std::string& title() const { return title_; } void set_title(const std::string& title) { title_ = title; } + const std::string& badge_text() const { return badge_text_; } + void set_badge_text(const std::string& badge_text) { + badge_text_ = badge_text; + } + + SkColor* badge_background_color() const { + return badge_background_color_.get(); + } + void set_badge_background_color(const SkColor& badge_background_color) { + badge_background_color_.reset(new SkColor(badge_background_color)); + } + int icon_index() const { return icon_index_; } void set_icon_index(int icon_index) { icon_index_ = icon_index; } @@ -101,6 +116,12 @@ class ExtensionActionState { // The icon to use. int icon_index_; + // The badge text. + std::string badge_text_; + + // The background color for the badge. + scoped_ptr<SkColor> badge_background_color_; + DISALLOW_COPY_AND_ASSIGN(ExtensionActionState); }; |