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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 195793004: Implement overscroll support for the virtual keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix work area resize when virtual keyboard is shown. Created 6 years, 8 months 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: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index ad374246f96ac5d750fb9703868bb584f8262ff5..2ff8ac8086548fb81fd1dea5ac6aca5ee52970f9 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -875,6 +875,23 @@ void RenderWidgetHostViewAura::SetBackground(const SkBitmap& background) {
window_->layer()->SetFillsBoundsOpaquely(background.isOpaque());
}
+int RenderWidgetHostViewAura::GetVisibleViewportHeight() const {
+ gfx::Rect window_bounds = window_->GetBoundsInScreen();
+ gfx::Rect intersect = gfx::IntersectRects(window_bounds,
+ virtual_keyboard_bounds_);
+ int overlap = intersect.height();
+ if (overlap > 0 && overlap < window_bounds.height())
+ return window_bounds.height() - overlap;
+ return GetViewBounds().height();
+}
+
+void RenderWidgetHostViewAura::SetKeyboardBounds(const gfx::Rect& bounds) {
sky 2014/04/23 20:47:08 Is there a reason you can't set an insets? I'm thi
kevers 2014/04/23 20:57:49 The reason for explicitly using screen coordinates
sky 2014/04/23 21:15:31 Isn't that an implementation detail? Can't the key
kevers 2014/04/24 02:02:13 Done.
+ if (bounds != virtual_keyboard_bounds_) {
+ virtual_keyboard_bounds_ = bounds;
+ host_->WasResized();
+ }
+}
+
void RenderWidgetHostViewAura::UpdateCursor(const WebCursor& cursor) {
current_cursor_ = cursor;
const gfx::Display display = gfx::Screen::GetScreenFor(window_)->

Powered by Google App Engine
This is Rietveld 408576698