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

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, 1 month 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..467fbee04358610b9cbd971f2618d2efcafe8627 100644
--- a/ui/keyboard/keyboard_controller_proxy.cc
+++ b/ui/keyboard/keyboard_controller_proxy.cc
@@ -71,6 +71,15 @@ 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) {
+ proxy_->SetKeyboardHeight(pos.height());
+ }
+
// Overridden from content::WebContentsDelegate:
virtual void RequestMediaAccessPermission(content::WebContents* web_contents,
const content::MediaStreamRequest& request,
@@ -94,7 +103,7 @@ class KeyboardContentsDelegate : public content::WebContentsDelegate,
namespace keyboard {
KeyboardControllerProxy::KeyboardControllerProxy()
- : default_url_(kKeyboardWebUIURL) {
+ : default_url_(kKeyboardWebUIURL), keyboard_resizer_(NULL) {
}
KeyboardControllerProxy::~KeyboardControllerProxy() {
@@ -112,6 +121,16 @@ void KeyboardControllerProxy::SetOverrideContentUrl(const GURL& url) {
ReloadContents();
}
+void KeyboardControllerProxy::SetKeyboardResizer(KeyboardResizer* resizer) {
+ keyboard_resizer_ = resizer;
+}
+
+void KeyboardControllerProxy::SetKeyboardHeight(int height) {
+ if (keyboard_resizer_) {
+ keyboard_resizer_->SetKeyboardHeight(height);
+ }
+}
+
void KeyboardControllerProxy::ReloadContents() {
if (keyboard_contents_) {
content::OpenURLParams params(
@@ -139,11 +158,13 @@ aura::Window* KeyboardControllerProxy::GetKeyboardWindow() {
}
void KeyboardControllerProxy::ShowKeyboardContainer(aura::Window* container) {
+ GetKeyboardWindow()->Show();
kevers 2013/11/29 20:26:05 Is it necessary to show/hide the keyboard window,
Shu Chen 2013/12/02 03:54:40 It is necessary, otherwise it won't trigger the vi
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