Chromium Code Reviews| Index: ui/keyboard/keyboard_controller_proxy.cc |
| diff --git a/ui/keyboard/keyboard_controller_proxy.cc b/ui/keyboard/keyboard_controller_proxy.cc |
| index 2d1bb4b537b703a50a68aef536320e56cabbff35..ae108e21af93b10afd2f50f360f8315a88097cb8 100644 |
| --- a/ui/keyboard/keyboard_controller_proxy.cc |
| +++ b/ui/keyboard/keyboard_controller_proxy.cc |
| @@ -71,6 +71,26 @@ class KeyboardContentsDelegate : public content::WebContentsDelegate, |
| return source; |
| } |
| + virtual bool IsPopupOrPanel(const content::WebContents* source) const { |
| + return true; |
| + } |
| + |
| + virtual void MoveContents( |
| + content::WebContents* source, const gfx::Rect& pos) { |
|
kevers
2013/12/03 00:08:12
OVERRIDE
Shu Chen
2013/12/03 01:54:42
Done.
|
| + aura::Window* keyboard = proxy_->GetKeyboardWindow(); |
| + gfx::Rect bounds = keyboard->bounds(); |
| + int new_height = pos.height(); |
| + bounds.set_y(bounds.y() + bounds.height() - new_height); |
| + bounds.set_height(new_height); |
| + // Records the keyboard new height. So that GetHitTestMask() can set the |
| + // same keyboard bounds as the hit test mask. |
| + keyboard::KeyboardControllerProxy::keyboard_height = new_height; |
| + |
| + keyboard::KeyboardControllerProxy::keyboard_resizing_from_contents = true; |
|
kevers
2013/12/03 00:08:12
Can set a non-static member and add a public acces
Shu Chen
2013/12/03 01:54:42
Done.
|
| + keyboard->SetBounds(bounds); |
| + keyboard::KeyboardControllerProxy::keyboard_resizing_from_contents = false; |
|
kevers
2013/12/03 00:08:12
Resetting might not be strictly required. See oth
Shu Chen
2013/12/03 01:54:42
Done.
|
| + } |
| + |
| // Overridden from content::WebContentsDelegate: |
| virtual void RequestMediaAccessPermission(content::WebContents* web_contents, |
| const content::MediaStreamRequest& request, |
| @@ -93,6 +113,10 @@ class KeyboardContentsDelegate : public content::WebContentsDelegate, |
| namespace keyboard { |
| +int KeyboardControllerProxy::keyboard_height = -1; |
| + |
| +bool KeyboardControllerProxy::keyboard_resizing_from_contents = false; |
| + |
| KeyboardControllerProxy::KeyboardControllerProxy() |
| : default_url_(kKeyboardWebUIURL) { |
| } |
| @@ -139,11 +163,13 @@ aura::Window* KeyboardControllerProxy::GetKeyboardWindow() { |
| } |
| void KeyboardControllerProxy::ShowKeyboardContainer(aura::Window* container) { |
| + GetKeyboardWindow()->Show(); |
| container->Show(); |
| } |
| void KeyboardControllerProxy::HideKeyboardContainer(aura::Window* container) { |
| container->Hide(); |
| + GetKeyboardWindow()->Hide(); |
| } |
| void KeyboardControllerProxy::SetUpdateInputType(ui::TextInputType type) { |