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

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

Issue 2028303004: Hide hover effect on hidden ink drop host views. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 7664f615332918ad415186babc7dc628cbfe803c..63b39a52cde369cf4580498926d4e1d49e75a11e 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -130,13 +130,13 @@ void CustomButton::OnEnabledChanged() {
if (enabled() ? (state_ != STATE_DISABLED) : (state_ == STATE_DISABLED))
return;
- if (enabled())
+ if (enabled()) {
SetState(ShouldEnterHoveredState() ? STATE_HOVERED : STATE_NORMAL);
- else
+ if (ink_drop_delegate())
+ ink_drop_delegate()->SetHovered(InDrag() && IsMouseHovered());
sky 2016/06/02 03:07:26 Why do you check the InDrag here? I have to admit
Evan Stade 2016/06/02 19:34:07 because I'm copying ShouldShowInkDropHover (minus
bruthig 2016/06/02 19:46:36 Feel free to make this name change, I will deal wi
+ } else {
SetState(STATE_DISABLED);
-
- if (ink_drop_delegate())
- ink_drop_delegate()->SetHovered(ShouldShowInkDropHover());
Evan Stade 2016/06/01 22:46:20 this change/fix is tangential
+ }
}
const char* CustomButton::GetClassName() const {
@@ -340,6 +340,7 @@ void CustomButton::GetAccessibleState(ui::AXViewState* state) {
}
void CustomButton::VisibilityChanged(View* starting_from, bool visible) {
+ Button::VisibilityChanged(starting_from, visible);
if (state_ == STATE_DISABLED)
return;
SetState(visible && ShouldEnterHoveredState() ? STATE_HOVERED : STATE_NORMAL);
« ui/views/animation/ink_drop_host_view.cc ('K') | « ui/views/animation/ink_drop_host_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698