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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_
6 #define CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_
7 #pragma once
8
9 #include "base/memory/scoped_ptr.h"
10
11 class SkBitmap;
12 class SkDevice;
13
14 namespace extensions {
15
16 // A container for a mutable SkBitmap.
17 class IconTransform {
18 public:
19 IconTransform();
20 ~IconTransform();
21
22 // Renders |icon| with the transformations applied.
23 const SkBitmap& RenderIcon(const SkBitmap& icon);
24
25 // Sets the transform's |alpha| to a value between 0 and 255.
26 // Returns a reference to this.
27 IconTransform& set_alpha(int alpha) {
28 alpha_ = alpha;
29 return *this;
30 }
31
32 private:
33 // The alpha.
34 int alpha_;
35
36 // Device used to paint the icon to.
37 scoped_ptr<SkDevice> device_;
38 };
39
40 } // namespace extensions
41
42
43 #endif // CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_
OLDNEW
« 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