OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_ICON_WITH_BADGE_IMAGE_SOURCE_H_ | 5 #ifndef CHROME_COMMON_ICON_WITH_BADGE_IMAGE_SOURCE_H_ |
6 #define CHROME_COMMON_ICON_WITH_BADGE_IMAGE_SOURCE_H_ | 6 #define CHROME_COMMON_ICON_WITH_BADGE_IMAGE_SOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
11 #include "ui/gfx/image/canvas_image_source.h" | 11 #include "ui/gfx/image/canvas_image_source.h" |
12 #include "ui/gfx/image/image.h" | 12 #include "ui/gfx/image/image.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class Size; | 15 class Size; |
16 } | 16 } |
17 | 17 |
18 // CanvasImageSource for creating extension icon with a badge. | 18 // CanvasImageSource for creating extension icon with a badge. |
19 // TODO(devlin): This class and its buddy badge_util don't really belong in | 19 // TODO(devlin): This class and its buddy badge_util don't really belong in |
20 // chrome/common/. | 20 // chrome/common/. |
21 class IconWithBadgeImageSource : public gfx::CanvasImageSource { | 21 class IconWithBadgeImageSource : public gfx::CanvasImageSource { |
22 public: | 22 public: |
23 // The data representing a badge to be painted over the base image. | 23 // The data representing a badge to be painted over the base image. |
24 struct Badge { | 24 struct Badge { |
25 Badge(std::string text, SkColor text_color, SkColor background_color); | 25 Badge(const std::string& text, |
| 26 SkColor text_color, |
| 27 SkColor background_color); |
26 ~Badge(); | 28 ~Badge(); |
27 | 29 |
28 std::string text; | 30 std::string text; |
29 SkColor text_color; | 31 SkColor text_color; |
30 SkColor background_color; | 32 SkColor background_color; |
31 | 33 |
32 private: | 34 private: |
33 DISALLOW_COPY_AND_ASSIGN(Badge); | 35 DISALLOW_COPY_AND_ASSIGN(Badge); |
34 }; | 36 }; |
35 | 37 |
(...skipping 29 matching lines...) Expand all Loading... |
65 bool grayscale_; | 67 bool grayscale_; |
66 | 68 |
67 // Whether or not to paint a decoration over the base icon to indicate the | 69 // Whether or not to paint a decoration over the base icon to indicate the |
68 // represented action wants to run. | 70 // represented action wants to run. |
69 bool paint_decoration_; | 71 bool paint_decoration_; |
70 | 72 |
71 DISALLOW_COPY_AND_ASSIGN(IconWithBadgeImageSource); | 73 DISALLOW_COPY_AND_ASSIGN(IconWithBadgeImageSource); |
72 }; | 74 }; |
73 | 75 |
74 #endif // CHROME_COMMON_ICON_WITH_BADGE_IMAGE_SOURCE_H_ | 76 #endif // CHROME_COMMON_ICON_WITH_BADGE_IMAGE_SOURCE_H_ |
OLD | NEW |