Commit 14ad380a authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Test for keyboardView change in KeyboardObserverHelper

In side by side mode, it is possible to switch the keyboard focus
between 2 applications. In that case, no notification is sent to Chrome.
But the keyboardView is recreated on getting the focus back, and it is
possible to use this signal to retrigger accessory view.

Bug: 1125095
Change-Id: I06e8301ab6aec8fa58a78fed2c94516a1d2fa3db
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2445410
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Auto-Submit: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Reviewed-by: default avatarJavier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815638}
parent 85645eb0
......@@ -24,6 +24,10 @@
@property(nonatomic, readwrite, getter=getKeyboardState)
KeyboardState keyboardState;
// The last known keyboard view. If this changes, it probably means that the
// application lost focus in multiwindow mode.
@property(nonatomic, weak) UIView* keyboardView;
@end
@implementation KeyboardObserverHelper
......@@ -172,8 +176,10 @@
isUndocked != self.keyboardState.isUndocked ||
isSplit != self.keyboardState.isSplit ||
isHardware != self.keyboardState.isHardware ||
isPicker != self.keyboardState.isPicker) {
isPicker != self.keyboardState.isPicker ||
keyboardView != self.keyboardView) {
self.keyboardState = {isVisible, isUndocked, isSplit, isHardware, isPicker};
self.keyboardView = keyboardView;
dispatch_async(dispatch_get_main_queue(), ^{
[self.consumer keyboardWillChangeToState:self.keyboardState];
});
......
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