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

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..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) {
« ui/keyboard/keyboard_controller_proxy.h ('K') | « ui/keyboard/keyboard_controller_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698