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

Unified Diff: chrome/browser/profiles/profile_avatar_icon_util.h

Issue 268073005: Bring back support for 38x31 avatars. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits and refactor GetAvatarIconAsSquare to have a return value. Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_avatar_icon_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_avatar_icon_util.h
diff --git a/chrome/browser/profiles/profile_avatar_icon_util.h b/chrome/browser/profiles/profile_avatar_icon_util.h
index ecc3642692cd6dd8563f4fedab80607d5d024526..6f228ae2e8b389dfbf881ef278bcd608271d0c5b 100644
--- a/chrome/browser/profiles/profile_avatar_icon_util.h
+++ b/chrome/browser/profiles/profile_avatar_icon_util.h
@@ -17,6 +17,8 @@ namespace gfx {
class Image;
}
+class SkBitmap;
+
namespace profiles {
// Avatar access.
@@ -63,6 +65,7 @@ bool IsDefaultAvatarIconIndex(size_t index);
// Checks if the given URL points to one of the default avatar icons. If it
// is, returns true and its index through |icon_index|. If not, returns false.
bool IsDefaultAvatarIconUrl(const std::string& icon_url, size_t *icon_index);
+
// Returns a version of |image| of a specific size. Note that no checks are
// done on the width/height so make sure they're reasonable values; in the
// range of 16-256 is probably best.
@@ -85,6 +88,10 @@ gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image,
int dst_width,
int dst_height);
+// Returns a bitmap with a couple of columns shaved off so it is more square,
+// so that when resized to a square aspect ratio it looks pretty.
+SkBitmap GetAvatarIconAsSquare(const SkBitmap& source_bitmap, int scale_factor);
+
} // namespace profiles
#endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_avatar_icon_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698