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

Unified Diff: chrome/common/extensions/icon_transform.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_action.cc ('k') | chrome/common/extensions/icon_transform.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/icon_transform.h
diff --git a/chrome/common/extensions/icon_transform.h b/chrome/common/extensions/icon_transform.h
new file mode 100644
index 0000000000000000000000000000000000000000..0de07c0c07c8ccf83a2cb0cbc6a43d598b85dd62
--- /dev/null
+++ b/chrome/common/extensions/icon_transform.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_
+#define CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_
+#pragma once
+
+#include "base/memory/scoped_ptr.h"
+
+class SkBitmap;
+class SkDevice;
+
+namespace extensions {
+
+// A container for a mutable SkBitmap.
+class IconTransform {
+ public:
+ IconTransform();
+ ~IconTransform();
+
+ // Renders |icon| with the transformations applied.
+ const SkBitmap& RenderIcon(const SkBitmap& icon);
+
+ // Sets the transform's |alpha| to a value between 0 and 255.
+ // Returns a reference to this.
+ IconTransform& set_alpha(int alpha) {
+ alpha_ = alpha;
+ return *this;
+ }
+
+ private:
+ // The alpha.
+ int alpha_;
+
+ // Device used to paint the icon to.
+ scoped_ptr<SkDevice> device_;
+};
+
+} // namespace extensions
+
+
+#endif // CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_
« no previous file with comments | « chrome/common/extensions/extension_action.cc ('k') | chrome/common/extensions/icon_transform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698