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

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

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
Index: chrome/browser/profiles/profile_shortcut_manager_win.cc
diff --git a/chrome/browser/profiles/profile_shortcut_manager_win.cc b/chrome/browser/profiles/profile_shortcut_manager_win.cc
index 721a73482d5201575e6122b1d1ca6fb182d78d3d..72256196a964929786ec37c968159783a6a13dde 100644
--- a/chrome/browser/profiles/profile_shortcut_manager_win.cc
+++ b/chrome/browser/profiles/profile_shortcut_manager_win.cc
@@ -43,8 +43,7 @@
#include "ui/gfx/icon_util.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_family.h"
-#include "ui/gfx/rect.h"
-#include "ui/gfx/skia_util.h"
+
using content::BrowserThread;
@@ -111,18 +110,16 @@ const int kProfileAvatarIconResources2x[] = {
SkBitmap BadgeIcon(const SkBitmap& app_icon_bitmap,
const SkBitmap& avatar_bitmap,
int scale_factor) {
- // All icons, whether cartoon, GAIA or placeholder, should be square.
- // TODO(mlerman) - uncomment the ASSERT once noms@ lands the square images.
- // DCHECK(avatar_bitmap.width() == avatar_bitmap.height());
-
+ SkBitmap source_bitmap =
+ profiles::GetAvatarIconAsSquare(avatar_bitmap, scale_factor);
int avatar_badge_size = kProfileAvatarBadgeSize;
if (app_icon_bitmap.width() != kShortcutIconSize) {
avatar_badge_size =
app_icon_bitmap.width() * kProfileAvatarBadgeSize / kShortcutIconSize;
}
SkBitmap sk_icon = skia::ImageOperations::Resize(
- avatar_bitmap, skia::ImageOperations::RESIZE_LANCZOS3, avatar_badge_size,
- avatar_bitmap.height() * avatar_badge_size / avatar_bitmap.width());
+ source_bitmap, skia::ImageOperations::RESIZE_LANCZOS3, avatar_badge_size,
+ source_bitmap.height() * avatar_badge_size / source_bitmap.width());
// Overlay the avatar on the icon, anchoring it to the bottom-right of the
// icon.
« no previous file with comments | « chrome/browser/profiles/profile_avatar_icon_util.cc ('k') | chrome/browser/resources/options/browser_options.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698