OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_KEYBOARD_WEBUI_VK_MOJO_HANDLER_H_ | 5 #ifndef UI_KEYBOARD_WEBUI_VK_MOJO_HANDLER_H_ |
6 #define UI_KEYBOARD_WEBUI_VK_MOJO_HANDLER_H_ | 6 #define UI_KEYBOARD_WEBUI_VK_MOJO_HANDLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "mojo/public/cpp/bindings/binding.h" | |
10 #include "ui/base/ime/input_method_observer.h" | 9 #include "ui/base/ime/input_method_observer.h" |
11 #include "ui/keyboard/webui/keyboard.mojom.h" | 10 #include "ui/keyboard/webui/keyboard.mojom.h" |
12 | 11 |
13 namespace keyboard { | 12 namespace keyboard { |
14 | 13 |
15 class VKMojoHandler : public KeyboardUIHandlerMojo, | 14 class VKMojoHandler : public mojo::InterfaceImpl<KeyboardUIHandlerMojo>, |
16 public ui::InputMethodObserver { | 15 public ui::InputMethodObserver { |
17 public: | 16 public: |
18 explicit VKMojoHandler(mojo::InterfaceRequest<KeyboardUIHandlerMojo> request); | 17 VKMojoHandler(); |
19 ~VKMojoHandler() override; | 18 ~VKMojoHandler() override; |
20 | 19 |
21 private: | 20 private: |
22 ui::InputMethod* GetInputMethod(); | 21 ui::InputMethod* GetInputMethod(); |
23 | 22 |
| 23 // mojo::InterfaceImpl<>: |
| 24 void OnConnectionEstablished() override; |
| 25 |
24 // KeyboardUIHandlerMojo: | 26 // KeyboardUIHandlerMojo: |
25 void SendKeyEvent(const mojo::String& event_type, | 27 void SendKeyEvent(const mojo::String& event_type, |
26 int32_t char_value, | 28 int32_t char_value, |
27 int32_t key_code, | 29 int32_t key_code, |
28 const mojo::String& key_name, | 30 const mojo::String& key_name, |
29 int32_t modifiers) override; | 31 int32_t modifiers) override; |
30 void HideKeyboard() override; | 32 void HideKeyboard() override; |
31 | 33 |
32 // ui::InputMethodObserver: | 34 // ui::InputMethodObserver: |
33 void OnTextInputTypeChanged(const ui::TextInputClient* client) override; | 35 void OnTextInputTypeChanged(const ui::TextInputClient* client) override; |
34 void OnFocus() override; | 36 void OnFocus() override; |
35 void OnBlur() override; | 37 void OnBlur() override; |
36 void OnCaretBoundsChanged(const ui::TextInputClient* client) override; | 38 void OnCaretBoundsChanged(const ui::TextInputClient* client) override; |
37 void OnTextInputStateChanged(const ui::TextInputClient* text_client) override; | 39 void OnTextInputStateChanged(const ui::TextInputClient* text_client) override; |
38 void OnInputMethodDestroyed(const ui::InputMethod* input_method) override; | 40 void OnInputMethodDestroyed(const ui::InputMethod* input_method) override; |
39 void OnShowImeIfNeeded() override; | 41 void OnShowImeIfNeeded() override; |
40 | 42 |
41 mojo::Binding<KeyboardUIHandlerMojo> binding_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(VKMojoHandler); | 43 DISALLOW_COPY_AND_ASSIGN(VKMojoHandler); |
44 }; | 44 }; |
45 | 45 |
46 } // namespace keyboard | 46 } // namespace keyboard |
47 | 47 |
48 #endif // UI_KEYBOARD_WEBUI_VK_MOJO_HANDLER_H_ | 48 #endif // UI_KEYBOARD_WEBUI_VK_MOJO_HANDLER_H_ |
OLD | NEW |