| 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_BROWSER_UI_EXTENSIONS_ICON_WITH_BADGE_IMAGE_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_ICON_WITH_BADGE_IMAGE_SOURCE_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_ICON_WITH_BADGE_IMAGE_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_ICON_WITH_BADGE_IMAGE_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 SkColor background_color; | 31 SkColor background_color; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 DISALLOW_COPY_AND_ASSIGN(Badge); | 34 DISALLOW_COPY_AND_ASSIGN(Badge); |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 explicit IconWithBadgeImageSource(const gfx::Size& size); | 37 explicit IconWithBadgeImageSource(const gfx::Size& size); |
| 38 ~IconWithBadgeImageSource() override; | 38 ~IconWithBadgeImageSource() override; |
| 39 | 39 |
| 40 void SetIcon(const gfx::Image& icon); | 40 void SetIcon(const gfx::Image& icon); |
| 41 void SetBadge(scoped_ptr<Badge> badge); | 41 void SetBadge(std::unique_ptr<Badge> badge); |
| 42 void set_grayscale(bool grayscale) { grayscale_ = grayscale; } | 42 void set_grayscale(bool grayscale) { grayscale_ = grayscale; } |
| 43 void set_paint_page_action_decoration(bool should_paint) { | 43 void set_paint_page_action_decoration(bool should_paint) { |
| 44 paint_page_action_decoration_ = should_paint; | 44 paint_page_action_decoration_ = should_paint; |
| 45 } | 45 } |
| 46 void set_paint_blocked_actions_decoration(bool should_paint) { | 46 void set_paint_blocked_actions_decoration(bool should_paint) { |
| 47 paint_blocked_actions_decoration_ = should_paint; | 47 paint_blocked_actions_decoration_ = should_paint; |
| 48 } | 48 } |
| 49 | 49 |
| 50 bool grayscale() const { return grayscale_; } | 50 bool grayscale() const { return grayscale_; } |
| 51 bool paint_page_action_decoration() const { | 51 bool paint_page_action_decoration() const { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 67 void PaintPageActionDecoration(gfx::Canvas* canvas); | 67 void PaintPageActionDecoration(gfx::Canvas* canvas); |
| 68 | 68 |
| 69 // Paints a decoration over the base icon to indicate that the extension has | 69 // Paints a decoration over the base icon to indicate that the extension has |
| 70 // a blocked action that wants to run. | 70 // a blocked action that wants to run. |
| 71 void PaintBlockedActionDecoration(gfx::Canvas* canvas); | 71 void PaintBlockedActionDecoration(gfx::Canvas* canvas); |
| 72 | 72 |
| 73 // The base icon to draw. | 73 // The base icon to draw. |
| 74 gfx::Image icon_; | 74 gfx::Image icon_; |
| 75 | 75 |
| 76 // An optional badge to draw over the base icon. | 76 // An optional badge to draw over the base icon. |
| 77 scoped_ptr<Badge> badge_; | 77 std::unique_ptr<Badge> badge_; |
| 78 | 78 |
| 79 // Whether or not the icon should be grayscaled (e.g., to show it is | 79 // Whether or not the icon should be grayscaled (e.g., to show it is |
| 80 // disabled). | 80 // disabled). |
| 81 bool grayscale_; | 81 bool grayscale_; |
| 82 | 82 |
| 83 // Whether or not to paint a decoration over the base icon to indicate the | 83 // Whether or not to paint a decoration over the base icon to indicate the |
| 84 // represented action wants to run. | 84 // represented action wants to run. |
| 85 bool paint_page_action_decoration_; | 85 bool paint_page_action_decoration_; |
| 86 | 86 |
| 87 // Whether or not to paint a decoration to indicate that the extension has | 87 // Whether or not to paint a decoration to indicate that the extension has |
| 88 // had actions blocked. | 88 // had actions blocked. |
| 89 bool paint_blocked_actions_decoration_; | 89 bool paint_blocked_actions_decoration_; |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(IconWithBadgeImageSource); | 91 DISALLOW_COPY_AND_ASSIGN(IconWithBadgeImageSource); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 #endif // CHROME_BROWSER_UI_EXTENSIONS_ICON_WITH_BADGE_IMAGE_SOURCE_H_ | 94 #endif // CHROME_BROWSER_UI_EXTENSIONS_ICON_WITH_BADGE_IMAGE_SOURCE_H_ |
| OLD | NEW |