Commit b449c4cf authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev Committed by Commit Bot

Do not toggle the recent browser before showing disambiguation menu

Currently if the Chrome icon is clicked while there are multiple
browser windows (or multiple tabs when clicked with Shift), the most
recently active browser window will be activated, then the
disambiguation menu will be shown. This startles the user, especially
if the browser window was previously minimized.
This CL prevents this from happening.

Bug: 926980
Test: manual
Change-Id: Ia86f9eb43c589928b22e9556e3c4c97abc194837
Reviewed-on: https://chromium-review.googlesource.com/c/1449104Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarYury Khmel <khmel@chromium.org>
Commit-Queue: Vladislav Kaznacheev <kaznacheev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628229}
parent b9f219b4
......@@ -255,9 +255,16 @@ void BrowserShortcutLauncherItemController::ItemSelected(
return;
}
ash::ShelfAction action =
ChromeLauncherController::instance()->ActivateWindowOrMinimizeIfActive(
last_browser->window(), items.size() == 1);
ash::ShelfAction action;
if (items.size() == 1) {
action =
ChromeLauncherController::instance()->ActivateWindowOrMinimizeIfActive(
last_browser->window(), true);
} else {
// Multiple targets, a menu will be shown. No need to activate or minimize
// the recently active browser.
action = ash::SHELF_ACTION_NONE;
}
std::move(callback).Run(action, std::move(items));
}
......
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