| 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_controller_proxy.h" | 9 #include "ui/keyboard/keyboard_controller_proxy.h" |
| 10 #include "ui/keyboard/keyboard_util.h" | 10 #include "ui/keyboard/keyboard_util.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 DCHECK(child == keyboard_); | 42 DCHECK(child == keyboard_); |
| 43 | 43 |
| 44 ui::LayerAnimator* animator = | 44 ui::LayerAnimator* animator = |
| 45 controller_->GetContainerWindow()->layer()->GetAnimator(); | 45 controller_->GetContainerWindow()->layer()->GetAnimator(); |
| 46 // Stops previous animation if a window resize is requested during animation. | 46 // Stops previous animation if a window resize is requested during animation. |
| 47 if (animator->is_animating()) | 47 if (animator->is_animating()) |
| 48 animator->StopAnimating(); | 48 animator->StopAnimating(); |
| 49 | 49 |
| 50 gfx::Rect old_bounds = child->bounds(); | 50 gfx::Rect old_bounds = child->bounds(); |
| 51 SetChildBoundsDirect(child, requested_bounds); | 51 SetChildBoundsDirect(child, requested_bounds); |
| 52 if (old_bounds.height() == 0 && child->bounds().height() != 0) { | 52 if (old_bounds.height() == 0 && child->bounds().height() != 0 && |
| 53 // The window height is set to 0 initially. If the height of |old_bounds| is | 53 controller_->wait_for_resize_to_show()) { |
| 54 // 0 and the new bounds is not 0, it probably means window.resizeTo is | 54 // The window height is set to 0 initially or before switch to an IME in a |
| 55 // called to set the window height. We should try to show keyboard again in | 55 // different extension. Virtual keyboard window may wait for this bounds |
| 56 // case the show keyboard request is called before the height is set. | 56 // change to correctly animate in. |
| 57 controller_->ShowKeyboard(false); | 57 controller_->ShowKeyboard(false); |
| 58 } else { | 58 } else if (controller_->keyboard_visible()) { |
| 59 controller_->NotifyKeyboardBoundsChanging(requested_bounds); | 59 controller_->NotifyKeyboardBoundsChanging(requested_bounds); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace keyboard | 63 } // namespace keyboard |
| OLD | NEW |