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

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

Issue 10703090: Turn pageAction.show -> browserAction.sensibleThing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: views (incomplete) Created 8 years, 5 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 5ea62f3e63e9d883be30089c9def4881ddd9ae6e..40dc0d492f4b51b9dd1b855c3fa2835b6417060e 100644
--- a/chrome/common/extensions/extension_action.h
+++ b/chrome/common/extensions/extension_action.h
@@ -15,12 +15,12 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "chrome/common/extensions/icon_transform.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/animation/linear_animation.h"
class GURL;
class SkBitmap;
-class SkDevice;
namespace gfx {
class Canvas;
@@ -93,8 +93,8 @@ class ExtensionAction {
// ui::LinearAnimation implementation.
virtual void AnimateToState(double state) OVERRIDE;
- // Device we use to paint icons to.
- mutable scoped_ptr<SkDevice> device_;
+ // Transformation to apply to the icon when rendered.
+ mutable extensions::IconTransform icon_transform_;
ObserverList<Observer> observers_;
@@ -224,6 +224,12 @@ class ExtensionAction {
// Runs an animation on a tab.
void RunIconAnimation(int tab_id);
+ // Renders |icon| in the "visible" state for |tab_id|: if visible then
+ // normal, if invisible then faded. This function only makes sense for
+ // browser actions; for page actions, not-visibile should imply not showing at
+ // all for that tab.
+ const SkBitmap& RenderIconVisibility(const SkBitmap& icon, int tab_id) const;
+
private:
template <class T>
struct ValueTraits {
@@ -278,6 +284,9 @@ class ExtensionAction {
// the legacy setIcon({iconIndex:...} method of the page actions API.
std::vector<std::string> icon_paths_;
+ // Transformation to apply to the icon when rendered.
+ mutable extensions::IconTransform icon_transform_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionAction);
};
« 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