OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/keyboard/keyboard_layout_manager.h" | 5 #include "ui/keyboard/keyboard_layout_manager.h" |
6 | 6 |
7 #include "ui/compositor/layer_animator.h" | 7 #include "ui/compositor/layer_animator.h" |
8 #include "ui/keyboard/keyboard_controller.h" | 8 #include "ui/keyboard/keyboard_controller.h" |
9 #include "ui/keyboard/keyboard_util.h" | 9 #include "ui/keyboard/keyboard_util.h" |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 ui::LayerAnimator* animator = | 64 ui::LayerAnimator* animator = |
65 controller_->GetContainerWindow()->layer()->GetAnimator(); | 65 controller_->GetContainerWindow()->layer()->GetAnimator(); |
66 // Stops previous animation if a window resize is requested during animation. | 66 // Stops previous animation if a window resize is requested during animation. |
67 if (animator->is_animating()) | 67 if (animator->is_animating()) |
68 animator->StopAnimating(); | 68 animator->StopAnimating(); |
69 | 69 |
70 controller_->GetContainerWindow()->SetBounds(new_bounds); | 70 controller_->GetContainerWindow()->SetBounds(new_bounds); |
71 SetChildBoundsDirect(keyboard_, gfx::Rect(new_bounds.size())); | 71 SetChildBoundsDirect(keyboard_, gfx::Rect(new_bounds.size())); |
72 | 72 |
73 if (controller_->keyboard_mode() == FULL_WIDTH) { | 73 if (old_bounds.height() == 0 && child->bounds().height() != 0 && |
74 if (old_bounds.height() == 0 && child->bounds().height() != 0 && | 74 controller_->show_on_resize()) { |
75 controller_->show_on_resize()) { | 75 // The window height is set to 0 initially or before switch to an IME in a |
76 // The window height is set to 0 initially or before switch to an IME in a | 76 // different extension. Virtual keyboard window may wait for this bounds |
77 // different extension. Virtual keyboard window may wait for this bounds | 77 // change to correctly animate in. |
78 // change to correctly animate in. | 78 controller_->ShowKeyboard(false); |
79 controller_->ShowKeyboard(false); | 79 } else { |
80 } else { | 80 if (controller_->keyboard_mode() == FULL_WIDTH) { |
81 // We need to send out this notification only if keyboard is visible since | 81 // We need to send out this notification only if keyboard is visible since |
82 // keyboard window is resized even if keyboard is hidden. | 82 // keyboard window is resized even if keyboard is hidden. |
83 if (controller_->keyboard_visible()) | 83 if (controller_->keyboard_visible()) |
84 controller_->NotifyKeyboardBoundsChanging(requested_bounds); | 84 controller_->NotifyKeyboardBoundsChanging(requested_bounds); |
| 85 } else if (controller_->keyboard_mode() == FLOATING) { |
| 86 controller_->NotifyKeyboardBoundsChanging(gfx::Rect()); |
85 } | 87 } |
86 } else if (controller_->keyboard_mode() == FLOATING) { | |
87 controller_->NotifyKeyboardBoundsChanging(gfx::Rect()); | |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 } // namespace keyboard | 91 } // namespace keyboard |
OLD | NEW |