From 20dae011bacebf4d70d0bf44cb606027695ce699 Mon Sep 17 00:00:00 2001 From: "kevers@chromium.org" Date: Wed, 7 May 2014 19:53:46 +0000 Subject: Reset insets when existing touchview mode. BUG=370090 Review URL: https://codereview.chromium.org/266883008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268904 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/keyboard/keyboard_controller.cc | 12 ++++++++++++ ui/keyboard/keyboard_controller.h | 3 +++ 2 files changed, 15 insertions(+) (limited to 'ui/keyboard') diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc index 1d84b50..0a2fd1f 100644 --- a/ui/keyboard/keyboard_controller.cc +++ b/ui/keyboard/keyboard_controller.cc @@ -201,6 +201,7 @@ KeyboardController::~KeyboardController() { container_->RemoveObserver(this); if (input_method_) input_method_->RemoveObserver(this); + ResetWindowInsets(); } // static @@ -438,6 +439,17 @@ void KeyboardController::ShowKeyboardInternal() { } } +void KeyboardController::ResetWindowInsets() { + const gfx::Insets insets; + scoped_ptr widgets( + content::RenderWidgetHost::GetRenderWidgetHosts()); + while (content::RenderWidgetHost* widget = widgets->GetNextHost()) { + content::RenderWidgetHostView* view = widget->GetView(); + if (view) + view->SetInsets(insets); + } +} + bool KeyboardController::WillHideKeyboard() const { return weak_factory_.HasWeakPtrs(); } diff --git a/ui/keyboard/keyboard_controller.h b/ui/keyboard/keyboard_controller.h index 2eb6653..7bd8e2f 100644 --- a/ui/keyboard/keyboard_controller.h +++ b/ui/keyboard/keyboard_controller.h @@ -122,6 +122,9 @@ class KEYBOARD_EXPORT KeyboardController : public ui::InputMethodObserver, // Show virtual keyboard immediately with animation. void ShowKeyboardInternal(); + // Clears any insets on web content windows. + void ResetWindowInsets(); + // Returns true if keyboard is scheduled to hide. bool WillHideKeyboard() const; -- cgit v1.1