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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7862ab63f5864ef91f01ed2b72b3bfe4378e89ae |
--- /dev/null |
+++ b/ui/views/mus/text_input_client_impl.cc |
@@ -0,0 +1,40 @@ |
+// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
sadrul
2016/08/16 20:01:51
no (c)
Hadi
2016/08/16 20:18:25
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ui/views/mus/text_input_client_impl.h" |
+ |
+#include "ui/base/ime/text_input_client.h" |
+ |
+namespace views { |
+ |
+TextInputClientImpl::TextInputClientImpl( |
+ ui::mojom::TextInputClientRequest request, |
+ ui::TextInputClient* text_input_client) |
+ : text_input_client_(text_input_client), |
+ binding_(this, std::move(request)) {} |
+ |
+TextInputClientImpl::~TextInputClientImpl() {} |
+ |
+void TextInputClientImpl::OnCompositionEvent( |
+ ui::mojom::CompositionEventPtr event) { |
+ switch (event->type) { |
+ case ui::mojom::CompositionEventType::INSERT_CHAR: |
+ text_input_client_->InsertChar(*(*event->key_event)->AsKeyEvent()); |
+ 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; |
+ } |
+} |
+ |
+} // namespace views |