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

Unified Diff: ui/keyboard/keyboard_controller.cc

Issue 240443006: Remove native VK window height logic and wait for resizeTo to setup VK window height (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 6 years, 8 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
Index: ui/keyboard/keyboard_controller.cc
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index 4dd085c6e05b33fd1b3c8d3609c8a41972008867..52c7c1477194cec5035abf0bb3903c853968afbf 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();
@@ -394,6 +394,8 @@ void KeyboardController::ShowKeyboard() {
base::Unretained(this))));
container_animator->AddObserver(animation_observer_.get());
+ proxy_->ShowKeyboardContainer(container_.get());
+
{
// Scope the following animation settings as we don't want to animate
// visibility change that triggered by a call to the base class function
@@ -406,8 +408,6 @@ void KeyboardController::ShowKeyboard() {
container_->SetTransform(gfx::Transform());
container_->layer()->SetOpacity(1.0);
}
-
- proxy_->ShowKeyboardContainer(container_.get());
}
bool KeyboardController::WillHideKeyboard() const {

Powered by Google App Engine
This is Rietveld 408576698