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

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

Issue 2406323002: CustomButton: restrict animation repaints to buttons that actually animate (Closed)
Patch Set: CustomButton: restrict animation repaints to buttons that actually animate 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
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 483d971bbea836c6fceacbee82433f7dcf3704a6..92e446671952020bd75ff4855370c73953dc9755 100644
--- a/ui/views/controls/button/image_button.cc
+++ b/ui/views/controls/button/image_button.cc
@@ -48,6 +48,8 @@ const gfx::ImageSkia& ImageButton::GetImage(ButtonState state) const {
}
void ImageButton::SetImage(ButtonState for_state, const gfx::ImageSkia* image) {
+ if (for_state == STATE_HOVERED)
+ set_animates_hover(bool(image));
images_[for_state] = image ? *image : gfx::ImageSkia();
PreferredSizeChanged();
if (state() == for_state)

Powered by Google App Engine
This is Rietveld 408576698