Commit 782034f7 authored by Thomas Tangl's avatar Thomas Tangl Committed by Commit Bot

[Dice] Make accounts submenu a native menu on Mac

This CL changes the run type in DiceAccountsMenu
to use a native menu on Mac and removes the definition
of the run type ALWAYS_VIEWS as it is not used anymore.

Bug: 813805
Change-Id: Ia97cba48de31bf4ed74b71982cfe8e3383a909eb
Reviewed-on: https://chromium-review.googlesource.com/956463Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Commit-Queue: Thomas Tangl <tangltom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542079}
parent 426614a3
......@@ -87,8 +87,8 @@ DiceAccountsMenu::DiceAccountsMenu(const std::vector<AccountInfo>& accounts,
void DiceAccountsMenu::Show(views::View* anchor_view) {
DCHECK(!runner_);
runner_ = std::make_unique<views::MenuRunner>(
&menu_, views::MenuRunner::COMBOBOX | views::MenuRunner::ALWAYS_VIEWS);
runner_ =
std::make_unique<views::MenuRunner>(&menu_, views::MenuRunner::COMBOBOX);
// Calculate custom anchor bounds to position the menu.
// The menu is aligned along the right edge (left edge in RTL mode) of the
// anchor, slightly shifted inside by |kAnchorInset| and overlapping
......
......@@ -95,11 +95,6 @@ class VIEWS_EXPORT MenuRunner {
// shelf uses the flag to continue dragging an item without lifting the
// finger after the context menu of the item is opened.
SEND_GESTURE_EVENTS_TO_OWNER = 1 << 7,
// Whether to always use a menu rendered with views::MenuItemView, even if
// the MenuRunnerImpl would otherwise pick a native implementation on this
// platform.
ALWAYS_VIEWS = 1 << 8,
};
// Creates a new MenuRunner, which may use a native menu if available.
......
......@@ -119,8 +119,7 @@ MenuRunnerImplInterface* MenuRunnerImplInterface::Create(
int32_t run_types,
const base::Closure& on_menu_closed_callback) {
if ((run_types & kNativeRunTypes) != 0 &&
(run_types & MenuRunner::IS_NESTED) == 0 &&
(run_types & MenuRunner::ALWAYS_VIEWS) == 0) {
(run_types & MenuRunner::IS_NESTED) == 0) {
return new MenuRunnerImplCocoa(menu_model, on_menu_closed_callback);
}
......
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