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

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

Issue 242150: Implement browserAction.setIcon(ImageData) for extensions. (Closed)
Patch Set: common function Created 11 years, 2 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
Index: chrome/common/extensions/extension_action.h
diff --git a/chrome/common/extensions/extension_action.h b/chrome/common/extensions/extension_action.h
index 70ea09379959016bdb09e8ebb68a2cb4cd0bfc8a..1ed6854b9406e02297a58e15104076c83b81cb88 100644
--- a/chrome/common/extensions/extension_action.h
+++ b/chrome/common/extensions/extension_action.h
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "googleurl/src/gurl.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
class ExtensionAction {
@@ -109,6 +110,9 @@ class ExtensionActionState {
int icon_index() const { return icon_index_; }
void set_icon_index(int icon_index) { icon_index_ = icon_index; }
+ SkBitmap* icon() const { return icon_.get(); }
+ void set_icon(SkBitmap* icon) { icon_.reset(icon); }
+
private:
// The title to use.
std::string title_;
@@ -116,7 +120,10 @@ class ExtensionActionState {
// The icon to use.
int icon_index_;
- // The badge text.
+ // If non-NULL, overrides icon_index.
+ scoped_ptr<SkBitmap> icon_;
+
+ // The badge text.
std::string badge_text_;
// The background color for the badge.
« no previous file with comments | « chrome/common/extensions/api/extension_api.json ('k') | chrome/renderer/extensions/extension_process_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698