| Index: ui/views/mus/text_input_client_impl.cc
|
| diff --git a/ui/views/mus/text_input_client_impl.cc b/ui/views/mus/text_input_client_impl.cc
|
| index 2503b7fe99355e89030002001347af50e7e40f4c..9e5b21621b359579720eeaf1aa22fb1f922207a4 100644
|
| --- a/ui/views/mus/text_input_client_impl.cc
|
| +++ b/ui/views/mus/text_input_client_impl.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "ui/views/mus/text_input_client_impl.h"
|
|
|
| +#include "base/strings/utf_string_conversions.h"
|
| #include "ui/base/ime/text_input_client.h"
|
| #include "ui/views/mus/input_method_mus.h"
|
|
|
| @@ -18,29 +19,28 @@ ui::mojom::TextInputClientPtr TextInputClientImpl::CreateInterfacePtrAndBind() {
|
| return binding_.CreateInterfacePtrAndBind();
|
| }
|
|
|
| -void TextInputClientImpl::OnCompositionEvent(
|
| - ui::mojom::CompositionEventPtr event) {
|
| - switch (event->type) {
|
| - case ui::mojom::CompositionEventType::INSERT_CHAR: {
|
| - DCHECK((*event->key_event)->IsKeyEvent());
|
| - ui::KeyEvent* key_event = (*event->key_event)->AsKeyEvent();
|
| - DCHECK(key_event->is_char());
|
| - text_input_client_->InsertChar(*key_event);
|
| - break;
|
| - }
|
| - case ui::mojom::CompositionEventType::CONFIRM:
|
| - text_input_client_->ConfirmCompositionText();
|
| - break;
|
| - case ui::mojom::CompositionEventType::CLEAR:
|
| - text_input_client_->ClearCompositionText();
|
| - break;
|
| - case ui::mojom::CompositionEventType::UPDATE:
|
| - case ui::mojom::CompositionEventType::INSERT_TEXT:
|
| - // TODO(moshayedi): crbug.com/631524. Implement these types of composition
|
| - // events once we have the necessary fields in ui.mojom.CompositionEvent.
|
| - NOTIMPLEMENTED();
|
| - break;
|
| - }
|
| +void TextInputClientImpl::SetCompositionText(
|
| + const ui::CompositionText& composition) {
|
| + text_input_client_->SetCompositionText(composition);
|
| +}
|
| +
|
| +void TextInputClientImpl::ConfirmCompositionText() {
|
| + text_input_client_->ConfirmCompositionText();
|
| +}
|
| +
|
| +void TextInputClientImpl::ClearCompositionText() {
|
| + text_input_client_->ClearCompositionText();
|
| +}
|
| +
|
| +void TextInputClientImpl::InsertText(const std::string& text) {
|
| + text_input_client_->InsertText(base::UTF8ToUTF16(text));
|
| +}
|
| +
|
| +void TextInputClientImpl::InsertChar(std::unique_ptr<ui::Event> event) {
|
| + DCHECK(event->IsKeyEvent());
|
| + ui::KeyEvent* key_event = event->AsKeyEvent();
|
| + DCHECK(key_event->is_char());
|
| + text_input_client_->InsertChar(*key_event);
|
| }
|
|
|
| } // namespace views
|
|
|