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

Unified Diff: chrome/browser/profiles/profile_info_util.cc

Issue 8711002: Add GAIA picture to Settings profile overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 1 month 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 | « chrome/browser/profiles/profile_info_util.h ('k') | chrome/browser/profiles/profile_info_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_info_util.cc
diff --git a/chrome/browser/profiles/profile_info_util.cc b/chrome/browser/profiles/profile_info_util.cc
index 9956d0e184c82a193aaf729000f73db2305db221..6a557b45c652f708dd7cabb51f1f220d4a00504c 100644
--- a/chrome/browser/profiles/profile_info_util.cc
+++ b/chrome/browser/profiles/profile_info_util.cc
@@ -35,6 +35,24 @@ gfx::Image GetAvatarIconForMenu(const gfx::Image& image,
return gfx::Image(new SkBitmap(canvas.ExtractBitmap()));
}
+gfx::Image GetAvatarIconForWebUI(const gfx::Image& image,
+ bool is_gaia_picture) {
+ if (!is_gaia_picture)
+ return image;
+
+ int length = std::min(kAvatarIconWidth, kAvatarIconHeight) - 2;
+ SkBitmap bmp = skia::ImageOperations::Resize(
+ image, skia::ImageOperations::RESIZE_BEST, length, length);
+ gfx::CanvasSkia canvas(kAvatarIconWidth, kAvatarIconHeight, false);
+
+ // Draw the icon centered on the canvas.
+ int x = (kAvatarIconWidth - length) / 2;
+ int y = (kAvatarIconHeight - length) / 2;
+ canvas.DrawBitmapInt(bmp, x, y);
+
+ return gfx::Image(new SkBitmap(canvas.ExtractBitmap()));
+}
+
gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image,
bool is_gaia_picture,
int dst_width,
« no previous file with comments | « chrome/browser/profiles/profile_info_util.h ('k') | chrome/browser/profiles/profile_info_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698