Index: ui/keyboard/keyboard_controller_proxy.cc |
diff --git a/ui/keyboard/keyboard_controller_proxy.cc b/ui/keyboard/keyboard_controller_proxy.cc |
index 92869462fb0643acc0a2fa64f615ec9bda5e8965..100b3f12e338332d1eff45090225c856e46fa88a 100644 |
--- a/ui/keyboard/keyboard_controller_proxy.cc |
+++ b/ui/keyboard/keyboard_controller_proxy.cc |
@@ -50,6 +50,10 @@ class KeyboardContentsDelegate : public content::WebContentsDelegate, |
virtual void MoveContents(content::WebContents* source, |
const gfx::Rect& pos) OVERRIDE { |
aura::Window* keyboard = proxy_->GetKeyboardWindow(); |
+ // keyboard window must have been added to keyboard container window at this |
+ // point. Otherwise, wrong keyboard bounds is used and may cause problem as |
+ // described in crbug.com/367788. |
+ DCHECK(keyboard->parent()); |
gfx::Rect bounds = keyboard->bounds(); |
int new_height = pos.height(); |
bounds.set_y(bounds.y() + bounds.height() - new_height); |