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

Unified Diff: ui/keyboard/keyboard_controller.cc

Issue 578653004: Overscroll for keyboard disabled while keyboard is hiding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: ) Created 6 years, 3 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
« no previous file with comments | « ui/keyboard/keyboard_controller.h ('k') | ui/keyboard/keyboard_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/keyboard_controller.cc
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index f8ab50064b319a7a724c154f25ced17eda6c8f27..1b7b9f3a8e5cba1d9b627117dc4899bbeda773e2 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -445,15 +445,19 @@ void KeyboardController::OnShowImeIfNeeded() {
ShowKeyboardInternal();
}
+bool KeyboardController::ShouldEnableInsets(aura::Window* window) {
+ aura::Window *keyboard_window = proxy_->GetKeyboardWindow();
+ return (keyboard_window->GetRootWindow() == window->GetRootWindow() &&
+ keyboard::IsKeyboardOverscrollEnabled() &&
+ proxy_->GetKeyboardWindow()->IsVisible() &&
+ keyboard_visible_);
+}
+
void KeyboardController::UpdateWindowInsets(aura::Window* window) {
aura::Window *keyboard_window = proxy_->GetKeyboardWindow();
if (window == keyboard_window)
return;
- bool enableInsets = (keyboard_window->GetRootWindow() ==
- window->GetRootWindow()) && keyboard::IsKeyboardOverscrollEnabled() &&
- proxy_->GetKeyboardWindow()->IsVisible();
-
scoped_ptr<content::RenderWidgetHostIterator> widgets(
content::RenderWidgetHost::GetRenderWidgetHosts());
while (content::RenderWidgetHost* widget = widgets->GetNextHost()) {
@@ -462,7 +466,7 @@ void KeyboardController::UpdateWindowInsets(aura::Window* window) {
gfx::Rect window_bounds = view->GetNativeView()->GetBoundsInScreen();
gfx::Rect intersect = gfx::IntersectRects(window_bounds,
proxy_->GetKeyboardWindow()->bounds());
- int overlap = enableInsets ? intersect.height() : 0;
+ int overlap = ShouldEnableInsets(window) ? intersect.height() : 0;
if (overlap > 0 && overlap < window_bounds.height())
view->SetInsets(gfx::Insets(0, 0, overlap, 0));
else
« no previous file with comments | « ui/keyboard/keyboard_controller.h ('k') | ui/keyboard/keyboard_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698