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

Unified Diff: chrome/browser/ui/views/location_bar/bubble_icon_view.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
Index: chrome/browser/ui/views/location_bar/bubble_icon_view.cc
diff --git a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
index aadea3e6eaa2a96e22ec79e83fe23130dbd381e0..c444502114848374e1ddc0117c2a3c593ad777e1 100644
--- a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
+++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
@@ -75,7 +75,7 @@ bool BubbleIconView::OnMousePressed(const ui::MouseEvent& event) {
// If the bubble is showing then don't reshow it when the mouse is released.
suppress_mouse_released_action_ = IsBubbleShowing();
if (!suppress_mouse_released_action_ && event.IsOnlyLeftMouseButton())
- AnimateInkDrop(views::InkDropState::ACTION_PENDING);
+ AnimateInkDrop(views::InkDropState::ACTION_PENDING, &event);
// We want to show the bubble on mouse release; that is the standard behavior
// for buttons.
@@ -95,8 +95,9 @@ void BubbleIconView::OnMouseReleased(const ui::MouseEvent& event) {
return;
const bool activated = HitTestPoint(event.location());
- AnimateInkDrop(activated ? views::InkDropState::ACTIVATED
- : views::InkDropState::HIDDEN);
+ AnimateInkDrop(
+ activated ? views::InkDropState::ACTIVATED : views::InkDropState::HIDDEN,
+ &event);
if (activated)
ExecuteCommand(EXECUTE_SOURCE_MOUSE);
OnPressed(activated);
@@ -106,7 +107,7 @@ bool BubbleIconView::OnKeyPressed(const ui::KeyEvent& event) {
if (event.key_code() != ui::VKEY_RETURN && event.key_code() != ui::VKEY_SPACE)
return false;
- AnimateInkDrop(views::InkDropState::ACTIVATED);
+ AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr /* &event */);
// As with CustomButton, return activates on key down and space activates on
// key up.
if (event.key_code() == ui::VKEY_RETURN)
@@ -161,7 +162,7 @@ bool BubbleIconView::ShouldShowInkDropForFocus() const {
void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_TAP) {
- AnimateInkDrop(views::InkDropState::ACTIVATED);
+ AnimateInkDrop(views::InkDropState::ACTIVATED, event);
ExecuteCommand(EXECUTE_SOURCE_GESTURE);
event->SetHandled();
}
@@ -175,7 +176,7 @@ void BubbleIconView::OnWidgetVisibilityChanged(views::Widget* widget,
bool visible) {
// |widget| is a bubble that has just got shown / hidden.
if (!visible)
- AnimateInkDrop(views::InkDropState::DEACTIVATED);
+ AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr /* event */);
}
void BubbleIconView::ExecuteCommand(ExecuteSource source) {

Powered by Google App Engine
This is Rietveld 408576698