Commit ae0bb765 authored by Dana Fried's avatar Dana Fried Committed by Commit Bot

Unify hover card fade-in times after NTB press.

Previously, it was possible for hover cards to still be in the fade-out/
cool-down period when the new tab pops under where the NTB was when it
was clicked, resulting in the hover card popping back to full visibility
without an animation. This forces a normal fade-in after NTB press.

Bug: 984038
Change-Id: Ie3d140637a149ce4cda22dc3ab41615007e052e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1756631Reviewed-by: default avatarCaroline Rising <corising@chromium.org>
Commit-Queue: Dana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687696}
parent 060c246f
......@@ -2956,6 +2956,11 @@ void TabStrip::ButtonPressed(views::Button* sender, const ui::Event& event) {
UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", TabStripModel::NEW_TAB_BUTTON,
TabStripModel::NEW_TAB_ENUM_COUNT);
if (event.IsMouseEvent()) {
// Prevent the hover card from popping back in immediately. This forces a
// normal fade-in.
if (hover_card_)
hover_card_->set_last_mouse_exit_timestamp(base::TimeTicks());
const ui::MouseEvent& mouse = static_cast<const ui::MouseEvent&>(event);
if (mouse.IsOnlyMiddleMouseButton()) {
if (ui::Clipboard::IsSupportedClipboardType(
......
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