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