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

Unified Diff: ui/keyboard/keyboard_controller.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: ui/keyboard/keyboard_controller.cc
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index 4dd085c6e05b33fd1b3c8d3609c8a41972008867..1c02f527881637121b8d8088e9376dfac51598c6 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -6,6 +6,9 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "content/public/browser/render_widget_host.h"
+#include "content/public/browser/render_widget_host_iterator.h"
+#include "content/public/browser/render_widget_host_view.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
#include "ui/base/cursor/cursor.h"
@@ -234,6 +237,21 @@ void KeyboardController::NotifyKeyboardBoundsChanging(
FOR_EACH_OBSERVER(KeyboardControllerObserver,
observer_list_,
OnKeyboardBoundsChanging(new_bounds));
+ if (keyboard::IsKeyboardOverscrollEnabled()) {
+ // Adjust the height of the viewport for visible windows on the primary
+ // display.
+ scoped_ptr<content::RenderWidgetHostIterator> widgets(
+ content::RenderWidgetHost::GetRenderWidgetHosts());
+ aura::Window *keyboard_window = proxy_->GetKeyboardWindow();
+ aura::Window *root_window = keyboard_window->GetRootWindow();
+ gfx::Insets insets(0, 0, new_bounds.height(), 0);
+ while (content::RenderWidgetHost* widget = widgets->GetNextHost()) {
+ content::RenderWidgetHostView* view = widget->GetView();
+ aura::Window *window = view->GetNativeView();
+ if (window != keyboard_window && window->GetRootWindow() == root_window)
+ view->SetInsets(insets);
+ }
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698