Commit 7f097e0f authored by Samuel Huang's avatar Samuel Huang Committed by Commit Bot

Reland "Fix browser menu button flood fill effect always originating from center"

This reverts commit b1d35c01.

Reason for revert: Speculative revert did not fix problem.

Original change's description:
> Revert "Fix browser menu button flood fill effect always originating from center"
> 
> This reverts commit 25016613.
> 
> Reason for revert: Speculative revert for
> virtual/mouseevent_fractional/fast/events/middleClickAutoscroll-click-hyperlink.html
> failure under WebKit Linux Trusty (dbg) .
> 
> Original change's description:
> > 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/1089495
> > Reviewed-by: Trent Apted <tapted@chromium.org>
> > Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#565538}
> 
> TBR=tapted@chromium.org,afakhry@chromium.org
> 
> Change-Id: Ib3c0639e217e4e62d6c8a1aa004eda721e318c4f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 819878
> Reviewed-on: https://chromium-review.googlesource.com/1092249
> Reviewed-by: Samuel Huang <huangs@chromium.org>
> Commit-Queue: Samuel Huang <huangs@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#565654}

TBR=huangs@chromium.org,tapted@chromium.org,afakhry@chromium.org

Change-Id: I6a7b6243c363699a3d7620190409022ba8d58a03
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 819878
Reviewed-on: https://chromium-review.googlesource.com/1093354Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565670}
parent dd63892e
......@@ -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