diff options
author | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-14 21:35:14 +0000 |
---|---|---|
committer | bshe@chromium.org <bshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-14 21:36:23 +0000 |
commit | 233d2eea462b4885c8c29287f987712445c0964d (patch) | |
tree | 5320aaea0e14d2b0d26d061494f347f469fd8387 | |
parent | 682d17ce54d8b2495789b38140593fa89d9c2310 (diff) | |
download | chromium_src-233d2eea462b4885c8c29287f987712445c0964d.zip chromium_src-233d2eea462b4885c8c29287f987712445c0964d.tar.gz chromium_src-233d2eea462b4885c8c29287f987712445c0964d.tar.bz2 |
Set keyboard height to 0 before show a keyboard in a different extension
This keeps the UX the same as Android.
As a side effect, it also fix issue 403789. Korea keyboard is in a
different extension and has a different keyboard height compare to US keyboard.
Before this CL, at lock screen, user see a white keyboard area that is of
korean keyboard height at first, then after US keyboard loaded, the white area
shrink to a smaller size and the US keyboard finally shows up.
After this CL, we wont see a white rectangle keyboard area and the US keyboard
only comes up after loaded.
BUG=403789
Review URL: https://codereview.chromium.org/470193002
Cr-Commit-Position: refs/heads/master@{#289704}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289704 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ui/keyboard/keyboard_controller_proxy.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/keyboard/keyboard_controller_proxy.cc b/ui/keyboard/keyboard_controller_proxy.cc index dec2b0f..097b0d62 100644 --- a/ui/keyboard/keyboard_controller_proxy.cc +++ b/ui/keyboard/keyboard_controller_proxy.cc @@ -169,6 +169,15 @@ void KeyboardControllerProxy::LoadSystemKeyboard() { void KeyboardControllerProxy::ReloadKeyboardIfNeeded() { DCHECK(keyboard_contents_); if (keyboard_contents_->GetURL() != GetVirtualKeyboardUrl()) { + if (keyboard_contents_->GetURL().GetOrigin() != + GetVirtualKeyboardUrl().GetOrigin()) { + // Sets keyboard window height to 0 before navigate to a keyboard in a + // different extension. This keeps the UX the same as Android. + gfx::Rect bounds = GetKeyboardWindow()->bounds(); + bounds.set_y(bounds.y() + bounds.height()); + bounds.set_height(0); + GetKeyboardWindow()->SetBounds(bounds); + } LoadContents(GetVirtualKeyboardUrl()); } } |