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

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

Issue 2406323002: CustomButton: restrict animation repaints to buttons that actually animate (Closed)
Patch Set: don't use bool(T*) Created 4 years, 2 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/custom_button.h ('k') | ui/views/controls/button/image_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 63092b9b8b3bf32ba476981eb37a8e138c5e8b1f..73d94ebe39b067ee674297e0a06b1dac78a0e4ba 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -94,6 +94,8 @@ void CustomButton::SetState(ButtonState state) {
}
void CustomButton::StartThrobbing(int cycles_til_stop) {
+ if (!animate_on_state_change_)
+ return;
is_throbbing_ = true;
hover_animation_.StartThrobbing(cycles_til_stop);
}
@@ -403,7 +405,6 @@ 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_(false),
« no previous file with comments | « ui/views/controls/button/custom_button.h ('k') | ui/views/controls/button/image_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698