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

Unified Diff: ui/keyboard/keyboard_layout_manager.cc

Issue 2101023002: Fire OnKeyboardBoundsChanging event when Display metrics changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_unittest.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_layout_manager.cc
diff --git a/ui/keyboard/keyboard_layout_manager.cc b/ui/keyboard/keyboard_layout_manager.cc
index fa5f76329cf87f791a70bce29997f68ff4e9e0b0..eb686b99078f32a648eab675c3abe707f9c28e41 100644
--- a/ui/keyboard/keyboard_layout_manager.cc
+++ b/ui/keyboard/keyboard_layout_manager.cc
@@ -19,7 +19,11 @@ void KeyboardLayoutManager::OnWindowResized() {
// desired bounds before changing the bounds of the virtual keyboard window.
gfx::Rect container_bounds = controller_->GetContainerWindow()->bounds();
// Always align container window and keyboard window.
- SetChildBoundsDirect(keyboard_, gfx::Rect(container_bounds.size()));
+ if (controller_->keyboard_mode() == FULL_WIDTH) {
+ SetChildBounds(keyboard_, gfx::Rect(container_bounds.size()));
bshe 2016/06/28 12:14:16 Would it possible for you to try rotate the screen
+ } else {
+ SetChildBoundsDirect(keyboard_, gfx::Rect(container_bounds.size()));
+ }
}
}
@@ -42,7 +46,6 @@ void KeyboardLayoutManager::SetChildBounds(aura::Window* child,
// window) should change the container window first. Then the child window is
// resized and covers the container window. Note the child's bound is only set
// in OnWindowResized.
- gfx::Rect old_bounds = controller_->GetContainerWindow()->bounds();
gfx::Rect new_bounds = requested_bounds;
if (controller_->keyboard_mode() == FULL_WIDTH) {
const gfx::Rect& window_bounds =
@@ -57,9 +60,12 @@ void KeyboardLayoutManager::SetChildBounds(aura::Window* child,
// Keyboard bounds should only be reset when it actually changes. Otherwise
// it interrupts the initial animation of showing the keyboard. Described in
// crbug.com/356753.
- if (new_bounds == old_bounds) {
+ gfx::Rect old_bounds = keyboard_->GetTargetBounds();
+ aura::Window::ConvertRectToTarget(keyboard_,
+ keyboard_->GetRootWindow(),
+ &old_bounds);
+ if (new_bounds == old_bounds)
return;
- }
ui::LayerAnimator* animator =
controller_->GetContainerWindow()->layer()->GetAnimator();
« no previous file with comments | « ui/keyboard/keyboard_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698