diff options
author | leng@chromium.org <leng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-25 04:35:30 +0000 |
---|---|---|
committer | leng@chromium.org <leng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-25 04:35:30 +0000 |
commit | 9c388be0afa0ec9d7d177f54faaab9e77deda954 (patch) | |
tree | ca78223cd834dff55a29ba2c759f48ca0497cbc0 /chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc | |
parent | 9e4c60c1a34f4f186ba9d4174427f7a2dbe56879 (diff) | |
download | chromium_src-9c388be0afa0ec9d7d177f54faaab9e77deda954.zip chromium_src-9c388be0afa0ec9d7d177f54faaab9e77deda954.tar.gz chromium_src-9c388be0afa0ec9d7d177f54faaab9e77deda954.tar.bz2 |
More robust key event handling for bubbles that do not close on resign key
events.
The window used to display a bubble, InfoBubbleWindow, shares its ‘key
window’ state with its parent window. As long as the bubble is dismissed
when it loses focus, this works. However, for bubbles that are not closed
when they lose focus, keyboard event handling becomes problematic.
All keyboard events are sent to the ‘key window’ first. If there is a bubble
visible, the event will be sent to the bubble first, even if the bubble is not the
first responder - due to its shared key window state. Before this change, for
bubbles which allow keyboard events for the browser (e.g. switching tabs,
closing the window), the bubble simply sends events back to the parent
window, which then handles the events properly.
However, due to the shared key window state, when the parent receives an
event, it may just re-dispatch it, resulting in it returning to the bubble. To
avoid this recursion, this CL adds a change: the bubble sets
allowShareParentKeyState to NO (don’t share key window state) for the
duration of having its parent handle the event.
Along with the above change when handling a keyboard event, this also sets
allowShareParentKeyState to NO when the bubble itself loses key window
state. This way, should a sibling window become key window, or its parent,
the bubble will not receive keyboard events. It sets allowShareParentKeyState
to YES when it becomes key window again.
Final change is to make sure that when focusLocationBar: is called, the
location bar becomes key window. This fixes a bug where using ctrl+l with a
bubble visible did not give key window to the omnibox.
BUG=380382,382653,381435
Review URL: https://codereview.chromium.org/315413003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279582 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc')
0 files changed, 0 insertions, 0 deletions