| 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 1079d5e209b3effa2f44cad0eab34d03e717b6c6..57a97f1a89337cbc967b58cbe036d3c0b1d4ee5c 100644
|
| --- a/ui/views/controls/button/image_button.cc
|
| +++ b/ui/views/controls/button/image_button.cc
|
| @@ -143,11 +143,12 @@ void ImageButton::OnBlur() {
|
| gfx::ImageSkia ImageButton::GetImageToPaint() {
|
| gfx::ImageSkia img;
|
|
|
| - if (!images_[STATE_HOVERED].isNull() && hover_animation_->is_animating()) {
|
| - img = gfx::ImageSkiaOperations::CreateBlendedImage(images_[STATE_NORMAL],
|
| - images_[STATE_HOVERED], hover_animation_->GetCurrentValue());
|
| + if (!images_[STATE_HOVERED].isNull() && hover_animation().is_animating()) {
|
| + img = gfx::ImageSkiaOperations::CreateBlendedImage(
|
| + images_[STATE_NORMAL], images_[STATE_HOVERED],
|
| + hover_animation().GetCurrentValue());
|
| } else {
|
| - img = images_[state_];
|
| + img = images_[state()];
|
| }
|
|
|
| return !img.isNull() ? img : images_[STATE_NORMAL];
|
| @@ -210,14 +211,14 @@ void ToggleImageButton::SetToggled(bool toggled) {
|
| NotifyAccessibilityEvent(ui::AX_EVENT_VALUE_CHANGED, true);
|
| }
|
|
|
| -void ToggleImageButton::SetToggledImage(ButtonState state,
|
| +void ToggleImageButton::SetToggledImage(ButtonState image_state,
|
| const gfx::ImageSkia* image) {
|
| if (toggled_) {
|
| - images_[state] = image ? *image : gfx::ImageSkia();
|
| - if (state_ == state)
|
| + images_[image_state] = image ? *image : gfx::ImageSkia();
|
| + if (state() == image_state)
|
| SchedulePaint();
|
| } else {
|
| - alternate_images_[state] = image ? *image : gfx::ImageSkia();
|
| + alternate_images_[image_state] = image ? *image : gfx::ImageSkia();
|
| }
|
| }
|
|
|
| @@ -228,19 +229,20 @@ void ToggleImageButton::SetToggledTooltipText(const base::string16& tooltip) {
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // ToggleImageButton, ImageButton overrides:
|
|
|
| -const gfx::ImageSkia& ToggleImageButton::GetImage(ButtonState state) const {
|
| +const gfx::ImageSkia& ToggleImageButton::GetImage(
|
| + ButtonState image_state) const {
|
| if (toggled_)
|
| - return alternate_images_[state];
|
| - return images_[state];
|
| + return alternate_images_[image_state];
|
| + return images_[image_state];
|
| }
|
|
|
| -void ToggleImageButton::SetImage(ButtonState state,
|
| +void ToggleImageButton::SetImage(ButtonState image_state,
|
| const gfx::ImageSkia* image) {
|
| if (toggled_) {
|
| - alternate_images_[state] = image ? *image : gfx::ImageSkia();
|
| + alternate_images_[image_state] = image ? *image : gfx::ImageSkia();
|
| } else {
|
| - images_[state] = image ? *image : gfx::ImageSkia();
|
| - if (state_ == state)
|
| + images_[image_state] = image ? *image : gfx::ImageSkia();
|
| + if (state() == image_state)
|
| SchedulePaint();
|
| }
|
| PreferredSizeChanged();
|
|
|