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

Unified Diff: ui/aura/mus/input_method_mus.cc

Issue 2626983003: IME for Mus: Send TextInputClient information to IMEDriver. (Closed)
Patch Set: fix mojo dependencies. Created 3 years, 11 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 | « services/ui/public/interfaces/ime/ime.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/input_method_mus.cc
diff --git a/ui/aura/mus/input_method_mus.cc b/ui/aura/mus/input_method_mus.cc
index fdce89854b392e868af4091a7d5b98b6ac86f9d5..230dfff77c49344b6d47022842ddf6e5476d8b8b 100644
--- a/ui/aura/mus/input_method_mus.cc
+++ b/ui/aura/mus/input_method_mus.cc
@@ -92,9 +92,8 @@ void InputMethodMus::OnTextInputTypeChanged(const ui::TextInputClient* client) {
UpdateTextInputType();
InputMethodBase::OnTextInputTypeChanged(client);
- if (input_method_) {
+ if (input_method_)
input_method_->OnTextInputTypeChanged(client->GetTextInputType());
- }
}
void InputMethodMus::OnCaretBoundsChanged(const ui::TextInputClient* client) {
@@ -124,10 +123,22 @@ void InputMethodMus::OnDidChangeFocusedClient(
InputMethodBase::OnDidChangeFocusedClient(focused_before, focused);
UpdateTextInputType();
+ // TODO(moshayedi): crbug.com/681563. Handle when there is no focused clients.
+ if (!focused)
+ return;
+
text_input_client_ = base::MakeUnique<TextInputClientImpl>(focused);
if (ime_server_) {
- ime_server_->StartSession(text_input_client_->CreateInterfacePtrAndBind(),
- MakeRequest(&input_method_));
+ ui::mojom::StartSessionDetailsPtr details =
+ ui::mojom::StartSessionDetails::New();
+ details->client = text_input_client_->CreateInterfacePtrAndBind();
+ details->input_method_request = MakeRequest(&input_method_);
+ details->text_input_type = focused->GetTextInputType();
+ details->text_input_mode = focused->GetTextInputMode();
+ details->text_direction = focused->GetTextDirection();
+ details->text_input_flags = focused->GetTextInputFlags();
+ details->caret_bounds = focused->GetCaretBounds();
+ ime_server_->StartSession(std::move(details));
}
}
« no previous file with comments | « services/ui/public/interfaces/ime/ime.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698