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

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

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
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | ui/views/controls/button/custom_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.h
diff --git a/ui/views/controls/button/custom_button.h b/ui/views/controls/button/custom_button.h
index a73d5008cf67e90ce6790de0f9bca7660573736c..87ae0671de860c57c73e4dc47d89d9d342e750c8 100644
--- a/ui/views/controls/button/custom_button.h
+++ b/ui/views/controls/button/custom_button.h
@@ -152,6 +152,9 @@ class VIEWS_EXPORT CustomButton : public Button, public gfx::AnimationDelegate {
// state). This does not take into account enabled state.
bool ShouldEnterHoveredState();
+ void set_animates_hover(bool animates) { animates_hover_ = animates; }
+ bool animates_hover() { return animates_hover_; }
+
// Overridden from Button:
void NotifyClick(const ui::Event& event) override;
void OnClickCanceled(const ui::Event& event) override;
@@ -191,6 +194,11 @@ class VIEWS_EXPORT CustomButton : public Button, public gfx::AnimationDelegate {
// The color of the ripple and hover.
SkColor ink_drop_base_color_;
+ // Whether this button has a hover effect. If this returns true, painting the
sky 2016/10/11 19:17:45 As you mentioned previously, it seems wrong that a
+ // button is taken to be dependent on the animation state and SchedulePaint()
+ // is called as the hover animation progresses.
+ bool animates_hover_ = false;
+
DISALLOW_COPY_AND_ASSIGN(CustomButton);
};
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698