Commit b8363b4e authored by Avery Musbach's avatar Avery Musbach Committed by Commit Bot

overview: Remove unnecessary check in OverviewSession::OnKeyEvent

When you press the Escape key, OverviewSession::OnKeyEvent checks for
split view mode with no overview windows, to avoid ending overview then.
This check is unnecessary because OverviewController::ToggleOverview
will bail out. It will hide the virtual keyboard first, but when you
press the Escape key in the first place, you must have an external
keyboard and therefore no virtual keyboard. FALLTHROUGH between case
ui::VKEY_BROWSER_BACK and case ui::VKEY_ESCAPE is also unnecessary, and
is inconsistent with between case ui::VKEY_RIGHT and case ui::VKEY_TAB.

Test: ash_unittests OverviewSessionTest.ExitOverviewWithKey
Change-Id: I26e5d6ae752d040aaf1bc40c798f00548c4730fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733727Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Commit-Queue: Avery Musbach <amusbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683681}
parent 2ef8736b
...@@ -818,12 +818,8 @@ void OverviewSession::OnKeyEvent(ui::KeyEvent* event) { ...@@ -818,12 +818,8 @@ void OverviewSession::OnKeyEvent(ui::KeyEvent* event) {
switch (event->key_code()) { switch (event->key_code()) {
case ui::VKEY_BROWSER_BACK: case ui::VKEY_BROWSER_BACK:
FALLTHROUGH;
case ui::VKEY_ESCAPE: case ui::VKEY_ESCAPE:
// Cancel overview unless we're in single split mode with no overview EndOverview();
// windows.
if (!(IsEmpty() && shell->split_view_controller()->InSplitViewMode()))
EndOverview();
break; break;
case ui::VKEY_UP: case ui::VKEY_UP:
++num_key_presses_; ++num_key_presses_;
......
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