| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_AURA_MUS_TEXT_INPUT_CLIENT_IMPL_H_ | 5 #ifndef UI_AURA_MUS_TEXT_INPUT_CLIENT_IMPL_H_ |
| 6 #define UI_AURA_MUS_TEXT_INPUT_CLIENT_IMPL_H_ | 6 #define UI_AURA_MUS_TEXT_INPUT_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "mojo/public/cpp/bindings/binding.h" | 8 #include "mojo/public/cpp/bindings/binding.h" |
| 9 #include "services/ui/public/interfaces/ime/ime.mojom.h" | 9 #include "services/ui/public/interfaces/ime/ime.mojom.h" |
| 10 #include "ui/base/ime/composition_text.h" | 10 #include "ui/base/ime/composition_text.h" |
| 11 #include "ui/base/ime/input_method_delegate.h" |
| 11 | 12 |
| 12 namespace ui { | 13 namespace ui { |
| 13 class TextInputClient; | 14 class TextInputClient; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace aura { | 17 namespace aura { |
| 17 | 18 |
| 18 // TextInputClientImpl receieves updates from IME drivers over Mojo IPC, and | 19 // TextInputClientImpl receieves updates from IME drivers over Mojo IPC, and |
| 19 // notifies the underlying ui::TextInputClient accordingly. | 20 // notifies the underlying ui::TextInputClient accordingly. |
| 20 class TextInputClientImpl : public ui::mojom::TextInputClient { | 21 class TextInputClientImpl : public ui::mojom::TextInputClient { |
| 21 public: | 22 public: |
| 22 explicit TextInputClientImpl(ui::TextInputClient* text_input_client); | 23 explicit TextInputClientImpl(ui::TextInputClient* text_input_client, |
| 24 ui::internal::InputMethodDelegate* delegate); |
| 23 ~TextInputClientImpl() override; | 25 ~TextInputClientImpl() override; |
| 24 | 26 |
| 25 ui::mojom::TextInputClientPtr CreateInterfacePtrAndBind(); | 27 ui::mojom::TextInputClientPtr CreateInterfacePtrAndBind(); |
| 26 | 28 |
| 27 private: | 29 private: |
| 28 // ui::mojom::TextInputClient: | 30 // ui::mojom::TextInputClient: |
| 29 void SetCompositionText(const ui::CompositionText& composition) override; | 31 void SetCompositionText(const ui::CompositionText& composition) override; |
| 30 void ConfirmCompositionText() override; | 32 void ConfirmCompositionText() override; |
| 31 void ClearCompositionText() override; | 33 void ClearCompositionText() override; |
| 32 void InsertText(const std::string& text) override; | 34 void InsertText(const std::string& text) override; |
| 33 void InsertChar(std::unique_ptr<ui::Event> event) override; | 35 void InsertChar(std::unique_ptr<ui::Event> event) override; |
| 36 void DispatchKeyEventPostIME( |
| 37 std::unique_ptr<ui::Event> event, |
| 38 const DispatchKeyEventPostIMECallback& callback) override; |
| 34 | 39 |
| 35 ui::TextInputClient* text_input_client_; | 40 ui::TextInputClient* text_input_client_; |
| 36 mojo::Binding<ui::mojom::TextInputClient> binding_; | 41 mojo::Binding<ui::mojom::TextInputClient> binding_; |
| 42 ui::internal::InputMethodDelegate* delegate_; |
| 37 | 43 |
| 38 DISALLOW_COPY_AND_ASSIGN(TextInputClientImpl); | 44 DISALLOW_COPY_AND_ASSIGN(TextInputClientImpl); |
| 39 }; | 45 }; |
| 40 | 46 |
| 41 } // namespace aura | 47 } // namespace aura |
| 42 | 48 |
| 43 #endif // UI_AURA_MUS_TEXT_INPUT_CLIENT_IMPL_H_ | 49 #endif // UI_AURA_MUS_TEXT_INPUT_CLIENT_IMPL_H_ |
| OLD | NEW |