summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-06 15:30:47 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-06 15:30:47 +0000
commit3f05f9de010f7a09748477792719ed831fa584a1 (patch)
treef0732f1a6b8a4b7fb37fadf4dce0d0009ee282ec
parent03838e231df0acc3dbcbb4d97198f5b82d13713b (diff)
downloadchromium_src-3f05f9de010f7a09748477792719ed831fa584a1.zip
chromium_src-3f05f9de010f7a09748477792719ed831fa584a1.tar.gz
chromium_src-3f05f9de010f7a09748477792719ed831fa584a1.tar.bz2
keyboard: Fix visibility.
Fixing View::GetVisibleBounds (http://codereview.chromium.org/6993045/) breaks the keyboard visibility. So layout the keyboard without any transform first, then start the animation for sliding in. Also, update the visibility first, then the size, so that the latter correctly triggers a size update of the contents. BUG=none TEST=none Review URL: http://codereview.chromium.org/7112026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87986 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/touch/frame/touch_browser_frame_view.cc10
-rw-r--r--views/controls/native/native_view_host_views.cc7
2 files changed, 12 insertions, 5 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 9ba9160..90ac5d0 100644
--- a/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
+++ b/chrome/browser/ui/touch/frame/touch_browser_frame_view.cc
@@ -164,12 +164,16 @@ void TouchBrowserFrameView::UpdateKeyboardAndLayout(bool should_show_keyboard) {
keyboard_showing_ = should_show_keyboard;
if (keyboard_showing_) {
- animation_->Show();
-
// We don't re-layout the client view until the animation ends (see
// AnimationEnded below) because we want the client view to occupy the
- // entire height during the animation.
+ // entire height during the animation. It is necessary to reset the
+ // transform for the keyboard first so that the contents are sized properly
+ // when layout, and then start the animation.
+ ui::Transform reset;
+ keyboard_->SetTransform(reset);
Layout();
+
+ animation_->Show();
} else {
animation_->Hide();
diff --git a/views/controls/native/native_view_host_views.cc b/views/controls/native/native_view_host_views.cc
index 8d28bb0..7d44818 100644
--- a/views/controls/native/native_view_host_views.cc
+++ b/views/controls/native/native_view_host_views.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -60,8 +60,11 @@ void NativeViewHostViews::ShowWidget(int x, int y, int w, int h) {
// x, y are in the coordinate system of the root view, but we're
// already properly positioned by virtue of being an actual views
// child of the NativeHostView, so disregard the origin.
- host_->views_view()->SetBounds(0, 0, w, h);
+ // It is important to update the visibility first, so that when the bounds is
+ // set, the contents get notified of the resize (because resizing a hidden
+ // views may not actually resize the contents).
host_->views_view()->SetVisible(true);
+ host_->views_view()->SetBounds(0, 0, w, h);
}
void NativeViewHostViews::HideWidget() {