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

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: Moved the call to profiles:: namespace outside the task thread. 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
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..a82d7e747b893e2e7e995c31e7ee387e173ad413 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,12 @@ 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.
+void GetAvatarIconAsSquare(const SkBitmap& source_bitmap,
+ int scale_factor,
+ SkBitmap& square_bitmap);
sky 2014/05/09 20:52:19 Style guide says refs passed to functions must be
Mike Lerman 2014/05/12 15:35:47 I had it like this originally, but then changed it
+
} // namespace profiles
#endif // CHROME_BROWSER_PROFILES_PROFILE_AVATAR_ICON_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698