summaryrefslogtreecommitdiffstats
path: root/chrome/common/badge_util.h
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 19:20:08 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 19:20:08 +0000
commitead68fa16bb57be280d19b30e6b592fd8f6192a0 (patch)
treeb07766252903cb7bffde4d96c232edce56da6471 /chrome/common/badge_util.h
parent722ec18ab0d520ff1b029bb961a92618c39f9f2d (diff)
downloadchromium_src-ead68fa16bb57be280d19b30e6b592fd8f6192a0.zip
chromium_src-ead68fa16bb57be280d19b30e6b592fd8f6192a0.tar.gz
chromium_src-ead68fa16bb57be280d19b30e6b592fd8f6192a0.tar.bz2
Add dynamic badge listing the # background pages on the wrench menu.
Add badge_util::DrawBadgeIconOverlay() which draws a dynamic text overlay over a badge icon. Add Windows support for rendering a dynamic icon showing the # background pages to the wrench menu. BUG=64144 TEST=Enable background page, look at wrench menu Review URL: http://codereview.chromium.org/5299001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/badge_util.h')
-rw-r--r--chrome/common/badge_util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/common/badge_util.h b/chrome/common/badge_util.h
index 606008e..57180ef 100644
--- a/chrome/common/badge_util.h
+++ b/chrome/common/badge_util.h
@@ -6,6 +6,9 @@
#define CHROME_COMMON_BADGE_UTIL_H_
#pragma once
+#include "base/string16.h"
+#include "third_party/skia/include/core/SkBitmap.h"
+
class SkPaint;
// badge_util provides a set of helper routines for rendering dynamically
@@ -16,6 +19,14 @@ namespace badge_util {
// rendering badge overlay text (correct font, typeface, etc).
SkPaint* GetBadgeTextPaintSingleton();
+// Given an |icon|, renders the |text| centered on the |icon|. If |text| is
+// too large to fit within the bounds of the image, the |fallback| string is
+// rendered instead (or nothing, if |fallback| is empty).
+SkBitmap DrawBadgeIconOverlay(const SkBitmap& icon,
+ float font_size_in_pixels,
+ const string16& text,
+ const string16& fallback);
+
} // namespace badge_util;
#endif // CHROME_COMMON_BADGE_UTIL_H_