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/base/ime/input_method_base.cc

Issue 2259033003: New accessibility virtual keyboard behavior in non-sticky mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added property definition Created 4 years, 4 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/base/ime/input_method_base.cc
diff --git a/ui/base/ime/input_method_base.cc b/ui/base/ime/input_method_base.cc
index 9a37f8dfde652adc7b930b5d823687e6c3fcb79d..531a7b3dcb3571613b26e435ef9174b4393df26d 100644
--- a/ui/base/ime/input_method_base.cc
+++ b/ui/base/ime/input_method_base.cc
@@ -59,6 +59,12 @@ TextInputClient* InputMethodBase::GetTextInputClient() const {
return text_input_client_;
}
+void InputMethodBase::set_available_bounds(gfx::Rect new_bounds) {
+ available_bounds_ = new_bounds;
+ if (text_input_client_)
+ text_input_client_->EnsureCaretInRect(available_bounds_);
+}
+
void InputMethodBase::OnTextInputTypeChanged(const TextInputClient* client) {
if (!IsTextInputClientFocused(client))
return;
@@ -141,6 +147,18 @@ void InputMethodBase::SetFocusedTextInputClientInternal(
text_input_client_ = client; // nullptr allowed.
OnDidChangeFocusedClient(old, client);
NotifyTextInputStateChanged(text_input_client_);
+
+ if (available_bounds_.IsEmpty())
+ return;
+
+ // Restore old focused window if moved.
+ if (old) {
sky 2016/08/19 00:16:40 In general chrome style is no {} around single lin
hariank 2016/08/19 00:45:38 Done.
+ old->EnsureCaretInRect(available_bounds_);
sky 2016/08/19 00:16:40 Why do you need to notify the previous TextInputCl
hariank 2016/08/19 00:45:38 The previous TextInputClient's window should be re
sky 2016/08/19 03:47:24 That makes sense. I would never expect a function
hariank 2016/08/19 17:54:39 Ok, added an OnClientFocusLost function.
+ }
+ // Move new focused window if necessary.
+ if (text_input_client_) {
+ text_input_client_->EnsureCaretInRect(available_bounds_);
+ }
}
std::vector<gfx::Rect> InputMethodBase::GetCompositionBounds(

Powered by Google App Engine
This is Rietveld 408576698