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

Unified Diff: ui/base/ime/input_method_base.cc

Issue 2240353002: move switch Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Virtual keyboard non-sticky mode changes. 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
« no previous file with comments | « ui/base/ime/input_method_base.h ('k') | ui/base/ui_base_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a005d79095973d795552270b3fd561b0042db857 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,19 @@ void InputMethodBase::SetFocusedTextInputClientInternal(
text_input_client_ = client; // nullptr allowed.
OnDidChangeFocusedClient(old, client);
NotifyTextInputStateChanged(text_input_client_);
+
+ if (available_bounds_.IsEmpty())
+ return;
+
+ if (old) {
+ LOG(ERROR) << "move old window";
+ old->EnsureCaretInRect(available_bounds_);
+ }
+ if (text_input_client_) {
+ LOG(ERROR) << "set focus, available bounds: "
+ << available_bounds_.ToString();
+ text_input_client_->EnsureCaretInRect(available_bounds_);
+ }
}
std::vector<gfx::Rect> InputMethodBase::GetCompositionBounds(
« no previous file with comments | « ui/base/ime/input_method_base.h ('k') | ui/base/ui_base_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698