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_BADGE_UTIL_H_ | 5 #ifndef CHROME_COMMON_BADGE_UTIL_H_ |
6 #define CHROME_COMMON_BADGE_UTIL_H_ | 6 #define CHROME_COMMON_BADGE_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // Helper routine that returns a singleton SkPaint object configured for | 25 // Helper routine that returns a singleton SkPaint object configured for |
26 // rendering badge overlay text (correct font, typeface, etc). | 26 // rendering badge overlay text (correct font, typeface, etc). |
27 SkPaint* GetBadgeTextPaintSingleton(); | 27 SkPaint* GetBadgeTextPaintSingleton(); |
28 | 28 |
29 // Given an |icon|, renders the |text| centered on the |icon|. If |text| is | 29 // Given an |icon|, renders the |text| centered on the |icon|. If |text| is |
30 // too large to fit within the bounds of the image, the |fallback| string is | 30 // too large to fit within the bounds of the image, the |fallback| string is |
31 // rendered instead (or nothing, if |fallback| is empty). | 31 // rendered instead (or nothing, if |fallback| is empty). |
32 SkBitmap DrawBadgeIconOverlay(const SkBitmap& icon, | 32 SkBitmap DrawBadgeIconOverlay(const SkBitmap& icon, |
33 float font_size_in_pixels, | 33 float font_size_in_pixels, |
34 const string16& text, | 34 const base::string16& text, |
35 const string16& fallback); | 35 const base::string16& fallback); |
36 | 36 |
37 // Paints badge with specified parameters to |canvas|. | 37 // Paints badge with specified parameters to |canvas|. |
38 void PaintBadge(gfx::Canvas* canvas, | 38 void PaintBadge(gfx::Canvas* canvas, |
39 const gfx::Rect& bounds, | 39 const gfx::Rect& bounds, |
40 const std::string& text, | 40 const std::string& text, |
41 const SkColor& text_color_in, | 41 const SkColor& text_color_in, |
42 const SkColor& background_color_in, | 42 const SkColor& background_color_in, |
43 int icon_width, | 43 int icon_width, |
44 extensions::ActionInfo::Type action_type); | 44 extensions::ActionInfo::Type action_type); |
45 | 45 |
46 } // namespace badge_util; | 46 } // namespace badge_util; |
47 | 47 |
48 #endif // CHROME_COMMON_BADGE_UTIL_H_ | 48 #endif // CHROME_COMMON_BADGE_UTIL_H_ |
OLD | NEW |