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

Unified Diff: ui/keyboard/keyboard_controller.cc

Issue 711243004: Fix virtual keyboard overscroll on Athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « athena/virtual_keyboard/virtual_keyboard_manager_impl.cc ('k') | no next file » | 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 4fdf8f0a020e5867077ccd7694263848c91f227d..4ee23b128c284c1dbe013cdd149b056115347b4e 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -145,17 +145,6 @@ void ToggleTouchEventLogging(bool enable) {
#endif
}
-aura::Window *GetFrameWindow(aura::Window *window) {
- // Each container window has a non-negative id. Stop traversing at the child
- // of a container window.
- if (!window)
- return NULL;
- while (window->parent() && window->parent()->id() < 0) {
- window = window->parent();
- }
- return window;
-}
-
} // namespace
namespace keyboard {
@@ -309,18 +298,18 @@ void KeyboardController::NotifyKeyboardBoundsChanging(
// window is created while the keyboard is visible.
scoped_ptr<content::RenderWidgetHostIterator> widgets(
content::RenderWidgetHost::GetRenderWidgetHosts());
- aura::Window *keyboard_window = proxy_->GetKeyboardWindow();
- aura::Window *root_window = keyboard_window->GetRootWindow();
+ aura::Window* keyboard_window = proxy_->GetKeyboardWindow();
+ aura::Window* root_window = keyboard_window->GetRootWindow();
while (content::RenderWidgetHost* widget = widgets->GetNextHost()) {
content::RenderWidgetHostView* view = widget->GetView();
// Can be NULL, e.g. if the RenderWidget is being destroyed or
// the render process crashed.
if (view) {
- aura::Window *window = view->GetNativeView();
+ aura::Window* window = view->GetNativeView();
// If virtual keyboard failed to load, a widget that displays error
// message will be created and adds as a child of the virtual keyboard
// window. We want to avoid add BoundsChangedObserver to that window.
- if (GetFrameWindow(window) != keyboard_window &&
+ if (!keyboard_window->Contains(window) &&
window->GetRootWindow() == root_window) {
gfx::Rect window_bounds = window->GetBoundsInScreen();
gfx::Rect intersect = gfx::IntersectRects(window_bounds,
@@ -576,7 +565,7 @@ void KeyboardController::HideAnimationFinished() {
}
void KeyboardController::AddBoundsChangedObserver(aura::Window* window) {
- aura::Window* target_window = GetFrameWindow(window);
+ aura::Window* target_window = window ? window->GetToplevelWindow() : nullptr;
if (target_window)
window_bounds_observer_->AddObservedWindow(target_window);
}
« no previous file with comments | « athena/virtual_keyboard/virtual_keyboard_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698