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

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

Issue 2042073002: Centered flood fill style ink drop ripples on mouse/touch points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed LocatedEvent::AsLocatedIfLocatedEvent() as FromIfValid(). Created 4 years, 6 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/label_button.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/menu_button.cc
diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc
index 20b3452374de8f1e6335e34c97250b56a45e2456..b89184916bd18716fcb9ef4c2a0ba9d6bd226c7b 100644
--- a/ui/views/controls/button/menu_button.cc
+++ b/ui/views/controls/button/menu_button.cc
@@ -13,6 +13,7 @@
#include "ui/display/screen.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
+#include "ui/events/event_utils.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/text_constants.h"
@@ -147,8 +148,10 @@ bool MenuButton::Activate(const ui::Event* event) {
menu_closed_time_ = TimeTicks::Now();
- if (!increment_pressed_lock_called && pressed_lock_count_ == 0)
- AnimateInkDrop(InkDropState::ACTION_TRIGGERED);
+ if (!increment_pressed_lock_called && pressed_lock_count_ == 0) {
+ AnimateInkDrop(InkDropState::ACTION_TRIGGERED,
+ ui::LocatedEvent::FromIfValid(event));
+ }
// We must return false here so that the RootView does not get stuck
// sending all mouse pressed events to us instead of the appropriate
@@ -156,7 +159,7 @@ bool MenuButton::Activate(const ui::Event* event) {
return false;
}
- AnimateInkDrop(InkDropState::HIDDEN);
+ AnimateInkDrop(InkDropState::HIDDEN, ui::LocatedEvent::FromIfValid(event));
return true;
}
@@ -222,7 +225,7 @@ void MenuButton::OnMouseReleased(const ui::MouseEvent& event) {
HitTestPoint(event.location()) && !InDrag()) {
Activate(&event);
} else {
- AnimateInkDrop(InkDropState::HIDDEN);
+ AnimateInkDrop(InkDropState::HIDDEN, &event);
LabelButton::OnMouseReleased(event);
}
}
@@ -376,7 +379,7 @@ void MenuButton::IncrementPressedLocked(bool snap_ink_drop_to_activated) {
if (snap_ink_drop_to_activated)
ink_drop()->SnapToActivated();
else
- AnimateInkDrop(InkDropState::ACTIVATED);
+ AnimateInkDrop(InkDropState::ACTIVATED, nullptr /* event */);
}
SetState(STATE_PRESSED);
}
@@ -398,7 +401,7 @@ void MenuButton::DecrementPressedLocked() {
// The widget may be null during shutdown. If so, it doesn't make sense to
// try to add an ink drop effect.
if (GetWidget() && state() != STATE_PRESSED)
- AnimateInkDrop(InkDropState::DEACTIVATED);
+ AnimateInkDrop(InkDropState::DEACTIVATED, nullptr /* event */);
}
}
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698