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

Unified Diff: chrome/browser/ui/views/avatar_menu_bubble_view.cc

Issue 10453101: Convert most of the rest of chrome to ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/ui/views/avatar_menu_bubble_view.cc
diff --git a/chrome/browser/ui/views/avatar_menu_bubble_view.cc b/chrome/browser/ui/views/avatar_menu_bubble_view.cc
index fbcf0e094ffd891b54cabcb94689bb1e97b2ff3a..f78fdb2e5bb7f6fdb14c8fbb4a0b24248e41d6e0 100644
--- a/chrome/browser/ui/views/avatar_menu_bubble_view.cc
+++ b/chrome/browser/ui/views/avatar_menu_bubble_view.cc
@@ -163,7 +163,7 @@ class ProfileItemView : public views::CustomButton,
const AvatarMenuModel::Item& item() { return item_; }
private:
- static SkBitmap GetBadgedIcon(const SkBitmap& icon);
+ static gfx::ImageSkia GetBadgedIcon(const gfx::ImageSkia& icon);
bool IsHighlighted();
@@ -180,9 +180,9 @@ ProfileItemView::ProfileItemView(const AvatarMenuModel::Item& item,
: views::CustomButton(switch_profile_listener),
item_(item) {
image_view_ = new ProfileImageView();
- SkBitmap profile_icon = *item_.icon.ToSkBitmap();
+ gfx::ImageSkia profile_icon = *item_.icon.ToImageSkia();
if (item_.active) {
- SkBitmap badged_icon(GetBadgedIcon(profile_icon));
+ gfx::ImageSkia badged_icon(GetBadgedIcon(profile_icon));
image_view_->SetImage(badged_icon);
} else {
image_view_->SetImage(profile_icon);
@@ -241,7 +241,7 @@ void ProfileItemView::Layout() {
icon_rect.set_size(image_view_->GetPreferredSize());
icon_rect.set_y((height() - icon_rect.height()) / 2);
} else {
- const SkBitmap& icon = image_view_->GetImage();
+ const gfx::ImageSkia& icon = image_view_->GetImage();
icon_rect = GetCenteredAndScaledRect(icon.width(), icon.height(), 0, 0,
profiles::kAvatarIconWidth, height());
}
@@ -312,12 +312,13 @@ void ProfileItemView::OnFocusStateChanged(bool has_focus) {
}
// static
-SkBitmap ProfileItemView::GetBadgedIcon(const SkBitmap& icon) {
+gfx::ImageSkia ProfileItemView::GetBadgedIcon(const gfx::ImageSkia& icon) {
gfx::Rect icon_rect = GetCenteredAndScaledRect(icon.width(), icon.height(),
0, 0, profiles::kAvatarIconWidth, kItemHeight);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- const SkBitmap* badge = rb.GetImageNamed(IDR_PROFILE_SELECTED).ToSkBitmap();
+ const gfx::ImageSkia* badge = rb.GetImageNamed(
+ IDR_PROFILE_SELECTED).ToImageSkia();
const float kBadgeOverlapRatioX = 1.0f / 5.0f;
int width = icon_rect.width() + badge->width() * kBadgeOverlapRatioX;
const float kBadgeOverlapRatioY = 1.0f / 3.0f;
« no previous file with comments | « chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc ('k') | chrome/browser/ui/views/avatar_menu_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698