diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-20 18:58:38 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-20 18:58:38 +0000 |
commit | 76cc967de7e8174f8ab920cf6ac44f60eca13576 (patch) | |
tree | c56996960037cbfaf6afef6850aace4380776dc0 /chrome/browser/ui/touch | |
parent | b83e8a33e5c10843a756db36b4d3536340c06e95 (diff) | |
download | chromium_src-76cc967de7e8174f8ab920cf6ac44f60eca13576.zip chromium_src-76cc967de7e8174f8ab920cf6ac44f60eca13576.tar.gz chromium_src-76cc967de7e8174f8ab920cf6ac44f60eca13576.tar.bz2 |
touchui: Make sure the textfield isn't obscured by the keyboard.
When the virtual keyboard pops up, it can end up hiding the textfield when it's
towards the bottom of the page. So make sure the textfield is visible after the
keyboard is displayed.
BUG=keyboard hides a focused textfield if it's towards the bottom of the page.
TEST=see bug
Review URL: http://codereview.chromium.org/6074001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/touch')
-rw-r--r-- | chrome/browser/ui/touch/frame/touch_browser_frame_view.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc b/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc index 39ae523..1fd5197 100644 --- a/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc +++ b/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc @@ -7,6 +7,7 @@ #include <algorithm> #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/renderer_host/site_instance.h" #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -98,6 +99,14 @@ void TouchBrowserFrameView::UpdateKeyboardAndLayout(bool should_show_keyboard) { // Because the NonClientFrameView is a sibling of the ClientView, we rely on // the parent to resize the ClientView instead of resizing it directly. GetParent()->Layout(); + + // The keyboard that pops up may end up hiding the text entry. So make sure + // the renderer scrolls when necessary to keep the textfield visible. + if (keyboard_showing_) { + RenderViewHost* host = + browser_view()->browser()->GetSelectedTabContents()->render_view_host(); + host->ScrollFocusedEditableNodeIntoView(); + } } void TouchBrowserFrameView::Observe(NotificationType type, |