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

Unified Diff: ui/views/controls/button/image_button.cc

Issue 10382144: Change SetImage, SetBackground, and SetToggledImage to take in a gfx::ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 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
« no previous file with comments | « ui/views/controls/button/image_button.h ('k') | ui/views/controls/button/image_button_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/image_button.cc
diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc
index 85c705d790794b15a8a409515a657eccd77d6ed0..35e4960373e93169a73437022c66c22722d2f47d 100644
--- a/ui/views/controls/button/image_button.cc
+++ b/ui/views/controls/button/image_button.cc
@@ -31,14 +31,14 @@ ImageButton::ImageButton(ButtonListener* listener)
ImageButton::~ImageButton() {
}
-void ImageButton::SetImage(ButtonState state, const SkBitmap* image) {
- images_[state] = image ? *image : SkBitmap();
+void ImageButton::SetImage(ButtonState state, const gfx::ImageSkia* image) {
+ images_[state] = image ? *image : gfx::ImageSkia();
PreferredSizeChanged();
}
void ImageButton::SetBackground(SkColor color,
- const SkBitmap* image,
- const SkBitmap* mask) {
+ const gfx::ImageSkia* image,
+ const gfx::ImageSkia* mask) {
if (!image || !mask) {
background_image_.reset();
return;
@@ -143,13 +143,13 @@ void ToggleImageButton::SetToggled(bool toggled) {
}
void ToggleImageButton::SetToggledImage(ButtonState state,
- const SkBitmap* image) {
+ const gfx::ImageSkia* image) {
if (toggled_) {
- images_[state] = image ? *image : SkBitmap();
+ images_[state] = image ? *image : gfx::ImageSkia();
if (state_ == state)
SchedulePaint();
} else {
- alternate_images_[state] = image ? *image : SkBitmap();
+ alternate_images_[state] = image ? *image : gfx::ImageSkia();
}
}
@@ -160,11 +160,12 @@ void ToggleImageButton::SetToggledTooltipText(const string16& tooltip) {
////////////////////////////////////////////////////////////////////////////////
// ToggleImageButton, ImageButton overrides:
-void ToggleImageButton::SetImage(ButtonState state, const SkBitmap* image) {
+void ToggleImageButton::SetImage(ButtonState state,
+ const gfx::ImageSkia* image) {
if (toggled_) {
- alternate_images_[state] = image ? *image : SkBitmap();
+ alternate_images_[state] = image ? *image : gfx::ImageSkia();
} else {
- images_[state] = image ? *image : SkBitmap();
+ images_[state] = image ? *image : gfx::ImageSkia();
if (state_ == state)
SchedulePaint();
}
« no previous file with comments | « ui/views/controls/button/image_button.h ('k') | ui/views/controls/button/image_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698