summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/avatar_menu_bubble_view.cc
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-05 15:51:00 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-05 15:51:00 +0000
commit1dde36363bcf351fd04f06df6b6efd6216391e31 (patch)
tree44939d90afd10d91f8ee6ad3871a3483ce8a7cd0 /chrome/browser/ui/views/avatar_menu_bubble_view.cc
parent2d1aa180ebdd5a1281a9789d1441c4396b9fd5e4 (diff)
downloadchromium_src-1dde36363bcf351fd04f06df6b6efd6216391e31.zip
chromium_src-1dde36363bcf351fd04f06df6b6efd6216391e31.tar.gz
chromium_src-1dde36363bcf351fd04f06df6b6efd6216391e31.tar.bz2
Converted the rest of chrome except for extensions and favicons to user ImageSkia
Used same conversion script as 10437006 Modified the following files afterwards: 1 chrome/browser/background/background_application_list_model.cc 2 chrome/browser/extensions/extension_install_ui.cc 3 chrome/browser/extensions/extension_install_ui.h 4 chrome/browser/speech/speech_recognition_bubble.cc 5 chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc 6 chrome/browser/speech/speech_recognition_bubble_gtk.cc 7 chrome/browser/speech/speech_recognition_tray_icon_controller.h 8 chrome/browser/task_manager/task_manager_resource_providers.cc 9 chrome/browser/ui/panels/panel_browser_frame_view.cc 10 chrome/browser/ui/search_engines/template_url_table_model.cc 11 chrome/browser/ui/search_engines/template_url_table_model.h 12 chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc 13 chrome/browser/ui/views/avatar_menu_button.cc 14 chrome/browser/ui/views/detachable_toolbar_view.cc 15 chrome/browser/ui/views/download/download_item_view.cc 16 chrome/browser/ui/views/extensions/extension_install_dialog_view.cc 17 chrome/browser/ui/views/location_bar/icon_label_bubble_view.h 18 chrome/browser/ui/views/location_bar/location_bar_view.cc 19 chrome/browser/ui/views/tab_icon_view.cc 20 chrome/browser/ui/views/tab_icon_view.h 21 chrome/browser/ui/views/tabs/tab_strip.cc Include, whitespace changes in 1 chrome/browser/automation/automation_provider_observers.cc 2 chrome/browser/background/background_application_list_model.h 3 chrome/browser/background/background_mode_manager.cc 4 chrome/browser/custom_home_pages_table_model.h 5 chrome/browser/download/download_util.cc 6 chrome/browser/extensions/extension_function_dispatcher.cc 7 chrome/browser/extensions/extension_install_dialog.cc 8 chrome/browser/extensions/extension_install_dialog.h 9 chrome/browser/ntp_background_util.cc 10 chrome/browser/speech/speech_recognition_bubble.h 11 chrome/browser/task_manager/task_manager.h 12 chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc 13 chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc 14 chrome/browser/ui/cocoa/task_manager_mac.h 15 chrome/browser/ui/views/about_chrome_view.cc 16 chrome/browser/ui/views/avatar_menu_bubble_view.cc 17 chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc 18 chrome/browser/ui/views/download/download_item_view.h 19 chrome/browser/ui/views/find_bar_view.cc 20 chrome/browser/ui/views/infobars/extension_infobar.cc 21 chrome/browser/ui/views/notifications/balloon_view.cc 22 chrome/browser/ui/views/page_info_bubble_view.cc 23 chrome/browser/ui/views/tabs/base_tab.cc 24 chrome/browser/ui/views/tabs/tab.cc 25 chrome/browser/ui/views/toolbar_view.cc Review URL: https://chromiumcodereview.appspot.com/10453101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140531 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/avatar_menu_bubble_view.cc')
-rw-r--r--chrome/browser/ui/views/avatar_menu_bubble_view.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/chrome/browser/ui/views/avatar_menu_bubble_view.cc b/chrome/browser/ui/views/avatar_menu_bubble_view.cc
index fbcf0e0..f78fdb2 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;