Index: ui/keyboard/keyboard_controller.cc |
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc |
index 4dd085c6e05b33fd1b3c8d3609c8a41972008867..6d898a8b95ca8dbee326152fb79c125296b0403a 100644 |
--- a/ui/keyboard/keyboard_controller.cc |
+++ b/ui/keyboard/keyboard_controller.cc |
@@ -275,9 +275,9 @@ void KeyboardController::RemoveObserver(KeyboardControllerObserver* observer) { |
observer_list_.RemoveObserver(observer); |
} |
-void KeyboardController::ShowAndLockKeyboard() { |
- set_lock_keyboard(true); |
- OnShowImeIfNeeded(); |
+void KeyboardController::ShowKeyboard(bool lock) { |
+ set_lock_keyboard(lock); |
+ ShowKeyboardInternal(); |
} |
void KeyboardController::OnWindowHierarchyChanged( |
@@ -298,7 +298,7 @@ void KeyboardController::OnTextInputStateChanged( |
return; |
if (IsKeyboardUsabilityExperimentEnabled()) { |
- OnShowImeIfNeeded(); |
+ ShowKeyboardInternal(); |
return; |
} |
@@ -337,6 +337,10 @@ void KeyboardController::OnInputMethodDestroyed( |
} |
void KeyboardController::OnShowImeIfNeeded() { |
+ ShowKeyboardInternal(); |
+} |
+ |
+void KeyboardController::ShowKeyboardInternal() { |
if (!container_.get()) |
return; |
@@ -350,7 +354,7 @@ void KeyboardController::OnShowImeIfNeeded() { |
proxy_->ReloadKeyboardIfNeeded(); |
- if (keyboard_visible_) |
+ if (keyboard_visible_ || proxy_->GetKeyboardWindow()->bounds().height() == 0) |
return; |
keyboard_visible_ = true; |
@@ -370,10 +374,6 @@ void KeyboardController::OnShowImeIfNeeded() { |
!container_->layer()->GetAnimator()->is_animating()) |
return; |
- ShowKeyboard(); |
-} |
- |
-void KeyboardController::ShowKeyboard() { |
ToggleTouchEventLogging(false); |
ui::LayerAnimator* container_animator = container_->layer()->GetAnimator(); |