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

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: Address reviewer feedback. 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..7dcda33f215a105ede5437a74f0f2b5750f550c8 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,33 @@ void RenderWidgetHostViewAura::SetBackground(const SkBitmap& background) {
window_->layer()->SetFillsBoundsOpaquely(background.isOpaque());
}
+gfx::SizeF RenderWidgetHostViewAura::GetVisibleViewportSize() const {
+ gfx::Rect window_bounds = window_->GetBoundsInScreen();
+ aura::Window* root_window = window_->GetRootWindow();
+ if (root_window) {
+ gfx::Rect root_window_bounds = root_window->GetBoundsInScreen();
+ gfx::Rect available_bounds = gfx::Rect(
+ root_window_bounds.x() + root_window_insets_.left(),
+ root_window_bounds.y() + root_window_insets_.top(),
+ root_window_bounds.width() - root_window_insets_.left() -
+ root_window_insets_.right(),
sky 2014/04/24 15:55:09 The insets should be relative to window_, not the
kevers 2014/04/24 18:38:33 Done. Added TODOs to keyboard controller to addre
+ root_window_bounds.height() - root_window_insets_.top() -
+ root_window_insets_.bottom());
+ gfx::Rect intersect = gfx::IntersectRects(window_bounds, available_bounds);
+ int overlap = intersect.height();
+ if (overlap > 0 && overlap < window_bounds.height())
+ return gfx::SizeF(intersect.width(), intersect.height());
+ }
+ return gfx::SizeF(GetViewBounds().width(), GetViewBounds().height());
+}
+
+void RenderWidgetHostViewAura::SetInsets(const gfx::Insets& insets) {
+ if (insets != root_window_insets_) {
+ root_window_insets_ = insets;
+ 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