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

Unified Diff: ui/keyboard/keyboard_controller.cc

Issue 20526005: Implement virtual keyboard hiding. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase yet again Created 7 years, 3 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.h ('k') | ui/keyboard/keyboard_ui_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/keyboard_controller.cc
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index e3fd61650b45f99b1ef9b172116f952d9b04d3bd..1b76cb61721a97321ae2a18ecc49041dc46c8dde 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -148,6 +148,16 @@ aura::Window* KeyboardController::GetContainerWindow() {
return container_;
}
+void KeyboardController::HideKeyboard() {
+ keyboard_visible_ = false;
+
+ FOR_EACH_OBSERVER(KeyboardControllerObserver,
+ observer_list_,
+ OnKeyboardBoundsChanging(gfx::Rect()));
+
+ proxy_->HideKeyboardContainer(container_);
+}
+
void KeyboardController::AddObserver(KeyboardControllerObserver* observer) {
observer_list_.AddObserver(observer);
}
@@ -203,6 +213,8 @@ void KeyboardController::OnTextInputStateChanged(
OnKeyboardBoundsChanging(container_->children()[0]->bounds()));
proxy_->ShowKeyboardContainer(container_);
} else {
+ // Set the visibility state here so that any queries for visibility
+ // before the timer fires returns the correct future value.
keyboard_visible_ = false;
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
@@ -222,13 +234,6 @@ void KeyboardController::OnInputMethodDestroyed(
input_method_ = NULL;
}
-void KeyboardController::HideKeyboard() {
- FOR_EACH_OBSERVER(KeyboardControllerObserver,
- observer_list_,
- OnKeyboardBoundsChanging(gfx::Rect()));
- proxy_->HideKeyboardContainer(container_);
-}
-
bool KeyboardController::WillHideKeyboard() const {
return weak_factory_.HasWeakPtrs();
}
« no previous file with comments | « ui/keyboard/keyboard_controller.h ('k') | ui/keyboard/keyboard_ui_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698