Commit 25016613 authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

Fix browser menu button flood fill effect always originating from center

The MenuButton::PressedLock used to be always created with a null
event from MenuController::Run() causing it to eventually call
AnimateInkDrop() with a null event, which then used to clear
the inkdrop host's `last_ripple_triggering_event_` which is
used as the point from which the flood fill is generated.

This CL passes the current located event (if any) to
MenuButton::PressedLock.

BUG=819878

Change-Id: I4fb18ab73f60c75af3bce948f44ac41a8c6683b8
Reviewed-on: https://chromium-review.googlesource.com/1089495Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565538}
parent 0c45ffd2
......@@ -424,11 +424,11 @@ void MenuController::Run(Widget* parent,
menu_start_time_ = base::TimeTicks::Now();
menu_start_mouse_press_loc_ = gfx::Point();
ui::Event* event = nullptr;
if (parent) {
View* root_view = parent->GetRootView();
if (root_view) {
const ui::Event* event =
static_cast<internal::RootView*>(root_view)->current_event();
event = static_cast<internal::RootView*>(root_view)->current_event();
if (event && event->type() == ui::ET_MOUSE_PRESSED) {
gfx::Point screen_loc(
static_cast<const ui::MouseEvent*>(event)->location());
......@@ -476,8 +476,10 @@ void MenuController::Run(Widget* parent,
// Set the selection, which opens the initial menu.
SetSelection(root, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY);
if (button)
pressed_lock_ = std::make_unique<MenuButton::PressedLock>(button);
if (button) {
pressed_lock_ = std::make_unique<MenuButton::PressedLock>(
button, false, ui::LocatedEvent::FromIfValid(event));
}
if (for_drop_) {
if (!is_nested_drag) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment