Commit b410bc94 authored by Blake O'Hare's avatar Blake O'Hare Committed by Commit Bot

Disable transient blur when invoking the launcher from the shelf.

When the launcher pops up, the search field has focus. If you do this
quickly after the virtual keyboard has been hidden, the transient blur
heuristic will cause the keyboard to be re-shown.

Backstory:
Some text boxes are actively focused (user presses a text field) and
some are passively focused (a window has a search box that is auto-
focused). The latter cases should not cause the keyboard to show up.
However, if the keyboard was recently dismissed, the "transient blur"
heuristic will cause any passively focused text field to invoke the
keyboard. The primary purpose of this is login flows that require you
to type your name on one screen and then your password on the next
screen (like the Gaia login flow) where the password field is passively
focused. By explicitly dismissing the keyboard, it will clear out the
counter for this heuristic and prevent the focused search field in the
launcher from causing the keyboard to open if it was previously open
in the past few seconds. The most common form this bug manifests is if
someone clicks away from the keyboard to dismiss it with the intention
of showing the shelf to immediately access the launcher.

Bug: 848664
Change-Id: Ibdcb7a64906498be052c0071a611fdb639fc32f5
Reviewed-on: https://chromium-review.googlesource.com/1088450
Commit-Queue: Blake O'Hare <blakeo@chromium.org>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Reviewed-by: default avatarYuichiro Hanada <yhanada@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567515}
parent 969df46d
......@@ -49,6 +49,7 @@
#include "ui/events/event_utils.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/point.h"
#include "ui/keyboard/keyboard_controller.h"
#include "ui/views/animation/bounds_animator.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/image_button.h"
......@@ -492,6 +493,10 @@ void ShelfView::ButtonPressed(views::Button* sender,
if (!ShouldEventActivateButton(sender, event))
return;
// Ensure the keyboard is hidden and stays hidden (as long as it isn't locked)
if (keyboard::KeyboardController::Get()->enabled())
keyboard::KeyboardController::Get()->HideKeyboardExplicitlyBySystem();
// Close the overflow bubble if an item on either shelf is clicked. Press
// events elsewhere will close the overflow shelf via OverflowBubble's
// PointerWatcher functionality.
......
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