Index: chrome/browser/profiles/avatar_menu_model.cc |
diff --git a/chrome/browser/profiles/avatar_menu_model.cc b/chrome/browser/profiles/avatar_menu_model.cc |
index 7126fc122f596eb7ac401d23683552a3d9d523db..73de8dbf72e8d7bb85e01376e2ad24cb0e7c3463 100644 |
--- a/chrome/browser/profiles/avatar_menu_model.cc |
+++ b/chrome/browser/profiles/avatar_menu_model.cc |
@@ -22,6 +22,8 @@ |
#include "grit/generated_resources.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/gfx/image/image.h" |
+#include "skia/ext/image_operations.h" |
+#include "ui/gfx/canvas_skia.h" |
using content::BrowserThread; |
@@ -152,7 +154,39 @@ void AvatarMenuModel::RebuildMenu() { |
const size_t count = profile_info_->GetNumberOfProfiles(); |
for (size_t i = 0; i < count; ++i) { |
- Item* item = new Item(i, profile_info_->GetAvatarIconOfProfileAtIndex(i)); |
+ Item* item = NULL; |
+ if (profile_info_->IsUsingCustomAvatarIconForProfileAtIndex(i)) { |
+ SkBitmap custom_bmp = |
+ profile_info_->GetGAIAPictureOfProfileAtIndex(i); |
+ SkBitmap rimage = skia::ImageOperations::Resize( |
+ custom_bmp, skia::ImageOperations::RESIZE_BEST, 29, 29); |
+ |
+ gfx::CanvasSkia canvas(38, 31, false); |
+ // canvas.FillRect(SkColorSetRGB(0xff, 0, 0), gfx::Rect(0, 0, 39, 32)); |
+ canvas.DrawBitmapInt(rimage, 4, 1); |
+ |
+ int x1 = 4; |
+ int y1 = 1; |
+ int x2 = x1 + 29; |
+ int y2 = y1 + 29; |
+ |
+ // Dark Shadow Top |
+ canvas.DrawLineInt(SkColorSetARGB(89, 0, 0, 0), |
+ x1 - 1, y1 - 1, x2 + 1, y1 - 1); |
+ canvas.DrawLineInt(SkColorSetARGB(89, 0, 0, 0), |
+ x1 - 1, y1, x1 - 1, y2); |
+ canvas.DrawLineInt(SkColorSetARGB(89, 0, 0, 0), |
+ x2, y1, x2, y2); |
+ canvas.DrawLineInt(SkColorSetARGB(89, 0, 0, 0), |
+ x1 - 1, y2 + 0, x2 + 1, y2 + 0); |
+ |
+ SkBitmap bmp = canvas.ExtractBitmap(); |
+ |
+ gfx::Image image2(new SkBitmap(bmp)); |
+ item = new Item(i, image2); |
+ } else { |
+ item = new Item(i, profile_info_->GetAvatarIconOfProfileAtIndex(i)); |
+ } |
item->name = profile_info_->GetNameOfProfileAtIndex(i); |
item->sync_state = profile_info_->GetUserNameOfProfileAtIndex(i); |
if (item->sync_state.empty()) { |