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

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

Issue 2447523002: [ash-md] Added different highlighting modes to the InkDropImpl. (Closed)
Patch Set: Fixed compile errors. Created 4 years, 1 month 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 73d94ebe39b067ee674297e0a06b1dac78a0e4ba..1ae4027213a6be71ffa70ad78273c86c24565053 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -211,6 +211,8 @@ void CustomButton::OnMouseCaptureLost() {
if (state_ != STATE_DISABLED)
SetState(STATE_NORMAL);
AnimateInkDrop(views::InkDropState::HIDDEN, nullptr /* event */);
+ ink_drop()->SetHovered(false);
+ Button::OnMouseCaptureLost();
}
void CustomButton::OnMouseEntered(const ui::MouseEvent& event) {
@@ -356,11 +358,6 @@ void CustomButton::VisibilityChanged(View* starting_from, bool visible) {
SetState(visible && ShouldEnterHoveredState() ? STATE_HOVERED : STATE_NORMAL);
}
-std::unique_ptr<InkDropHighlight> CustomButton::CreateInkDropHighlight() const {
- return ShouldShowInkDropHighlight() ? Button::CreateInkDropHighlight()
- : nullptr;
-}
-
SkColor CustomButton::GetInkDropBaseColor() const {
return ink_drop_base_color_;
}
@@ -429,11 +426,6 @@ bool CustomButton::ShouldEnterPushedState(const ui::Event& event) {
return IsTriggerableEvent(event);
}
-bool CustomButton::ShouldShowInkDropHighlight() const {
- return enabled() && !InDrag() &&
- (IsMouseHovered() || (ShouldShowInkDropForFocus() && HasFocus()));
-}
-
bool CustomButton::ShouldEnterHoveredState() {
if (!visible())
return false;

Powered by Google App Engine
This is Rietveld 408576698