Commit 9cab92fd authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Trigger AvatarToolbarButton menu on LMB press

This makes the AvatarToolbarButton toggle like a MenuButton similarly to
the adjacent BrowserAppMenuButton (which is actually a MenuButton).

Bug: chromium:849911
Change-Id: I30690c61dd9b9b58b80e28dcbc85dc9e72835b9d
Reviewed-on: https://chromium-review.googlesource.com/1091592
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565440}
parent fee8b56a
...@@ -47,8 +47,11 @@ AvatarToolbarButton::AvatarToolbarButton(Profile* profile, ...@@ -47,8 +47,11 @@ AvatarToolbarButton::AvatarToolbarButton(Profile* profile,
if (!ui::MaterialDesignController::IsTouchOptimizedUiEnabled()) if (!ui::MaterialDesignController::IsTouchOptimizedUiEnabled())
SetBorder(views::CreateEmptyBorder(gfx::Insets(4))); SetBorder(views::CreateEmptyBorder(gfx::Insets(4)));
set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON | // Activate on press for left-mouse-button only to mimic other MenuButtons
ui::EF_MIDDLE_MOUSE_BUTTON); // without drag-drop actions (specifically the adjacent browser menu).
set_notify_action(Button::NOTIFY_ON_PRESS);
set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON);
set_tag(IDC_SHOW_AVATAR_MENU); set_tag(IDC_SHOW_AVATAR_MENU);
set_id(VIEW_ID_AVATAR_BUTTON); set_id(VIEW_ID_AVATAR_BUTTON);
......
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