Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Unified Diff: ui/keyboard/keyboard_controller_proxy.cc

Issue 97013002: [Input View] Makes the input view window support window.resizeTo() and w3c visibility API its web c… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..40862044e4712571c078896ea5077c2bd44a0970 100644
--- a/ui/keyboard/keyboard_controller_proxy.cc
+++ b/ui/keyboard/keyboard_controller_proxy.cc
@@ -71,6 +71,23 @@ class KeyboardContentsDelegate : public content::WebContentsDelegate,
return source;
}
+ virtual bool IsPopupOrPanel(const content::WebContents* source) const
+ OVERRIDE {
+ return true;
+ }
+
+ virtual void MoveContents(
+ content::WebContents* source, const gfx::Rect& pos) OVERRIDE {
+ 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);
+ proxy_->set_resizing_from_contents(true);
+ keyboard->SetBounds(bounds);
+ proxy_->set_resizing_from_contents(false);
+ }
+
// Overridden from content::WebContentsDelegate:
virtual void RequestMediaAccessPermission(content::WebContents* web_contents,
const content::MediaStreamRequest& request,
@@ -94,7 +111,7 @@ class KeyboardContentsDelegate : public content::WebContentsDelegate,
namespace keyboard {
KeyboardControllerProxy::KeyboardControllerProxy()
- : default_url_(kKeyboardWebUIURL) {
+ : default_url_(kKeyboardWebUIURL), resizing_from_contents_(false) {
}
KeyboardControllerProxy::~KeyboardControllerProxy() {
@@ -139,11 +156,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) {

Powered by Google App Engine
This is Rietveld 408576698