Index: ui/views/controls/button/custom_button.cc |
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc |
index e8ce4a003e394c3ff8f5ae260888f8806ddf8b1c..b23d02acf7904c5b4c416dbd93196253b7d9f8a9 100644 |
--- a/ui/views/controls/button/custom_button.cc |
+++ b/ui/views/controls/button/custom_button.cc |
@@ -66,21 +66,21 @@ void CustomButton::SetState(ButtonState state) { |
return; |
if (animate_on_state_change_ && |
- (!is_throbbing_ || !hover_animation_->is_animating())) { |
+ (!is_throbbing_ || !hover_animation_.is_animating())) { |
is_throbbing_ = false; |
if ((state_ == STATE_HOVERED) && (state == STATE_NORMAL)) { |
// For HOVERED -> NORMAL, animate from hovered (1) to not hovered (0). |
- hover_animation_->Hide(); |
+ hover_animation_.Hide(); |
} else if (state != STATE_HOVERED) { |
// For HOVERED -> PRESSED/DISABLED, or any transition not involving |
// HOVERED at all, simply set the state to not hovered (0). |
- hover_animation_->Reset(); |
+ hover_animation_.Reset(); |
} else if (state_ == STATE_NORMAL) { |
// For NORMAL -> HOVERED, animate from not hovered (0) to hovered (1). |
- hover_animation_->Show(); |
+ hover_animation_.Show(); |
} else { |
// For PRESSED/DISABLED -> HOVERED, simply set the state to hovered (1). |
- hover_animation_->Reset(1); |
+ hover_animation_.Reset(1); |
} |
} |
@@ -91,18 +91,18 @@ void CustomButton::SetState(ButtonState state) { |
void CustomButton::StartThrobbing(int cycles_til_stop) { |
is_throbbing_ = true; |
- hover_animation_->StartThrobbing(cycles_til_stop); |
+ hover_animation_.StartThrobbing(cycles_til_stop); |
} |
void CustomButton::StopThrobbing() { |
- if (hover_animation_->is_animating()) { |
- hover_animation_->Stop(); |
+ if (hover_animation_.is_animating()) { |
+ hover_animation_.Stop(); |
SchedulePaint(); |
} |
} |
void CustomButton::SetAnimationDuration(int duration) { |
- hover_animation_->SetSlideDuration(duration); |
+ hover_animation_.SetSlideDuration(duration); |
} |
void CustomButton::SetHotTracked(bool is_hot_tracked) { |
@@ -244,7 +244,7 @@ void CustomButton::OnGestureEvent(ui::GestureEvent* event) { |
// STATE_NORMAL beginning the fade out animation. See |
// http://crbug.com/131184. |
SetState(STATE_HOVERED); |
- hover_animation_->Reset(1.0); |
+ hover_animation_.Reset(1.0); |
NotifyClick(*event); |
event->StopPropagation(); |
} else if (event->type() == ui::ET_GESTURE_TAP_DOWN && |
@@ -337,14 +337,14 @@ void CustomButton::AnimationProgressed(const gfx::Animation* animation) { |
CustomButton::CustomButton(ButtonListener* listener) |
: Button(listener), |
state_(STATE_NORMAL), |
+ hover_animation_(this), |
animate_on_state_change_(true), |
is_throbbing_(false), |
triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON), |
request_focus_on_press_(true), |
ink_drop_delegate_(nullptr), |
notify_action_(NOTIFY_ON_RELEASE) { |
- hover_animation_.reset(new gfx::ThrobAnimation(this)); |
- hover_animation_->SetSlideDuration(kHoverFadeDurationMs); |
+ hover_animation_.SetSlideDuration(kHoverFadeDurationMs); |
} |
void CustomButton::StateChanged() { |