| 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 CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include "services/ui/public/interfaces/ime/ime.mojom.h" | 8 #include "services/ui/public/interfaces/ime/ime.mojom.h" |
| 9 #include "ui/base/ime/input_method_chromeos.h" | 9 #include "ui/base/ime/input_method_chromeos.h" |
| 10 | 10 |
| 11 // This bridges between mojo InputMethod API and ui::InputMethodChromeOS. It | 11 // This bridges between mojo InputMethod API and ui::InputMethodChromeOS. It |
| 12 // forwards the received events to an instance of ui::InputMethodChromeOS. | 12 // forwards the received events to an instance of ui::InputMethodChromeOS. |
| 13 class InputMethodBridge : public ui::mojom::InputMethod { | 13 class InputMethodBridge : public ui::mojom::InputMethod { |
| 14 public: | 14 public: |
| 15 explicit InputMethodBridge(ui::mojom::TextInputClientPtr client); | 15 explicit InputMethodBridge(ui::mojom::TextInputClientPtr client); |
| 16 ~InputMethodBridge() override; | 16 ~InputMethodBridge() override; |
| 17 | 17 |
| 18 // ui::mojom::InputMethod: | 18 // ui::mojom::InputMethod: |
| 19 void OnTextInputModeChanged( | 19 void OnTextInputModeChanged(ui::TextInputMode text_input_mode) override; |
| 20 ui::mojom::TextInputMode text_input_mode) override; | 20 void OnTextInputTypeChanged(ui::TextInputType text_input_type) override; |
| 21 void OnTextInputTypeChanged( | |
| 22 ui::mojom::TextInputType text_input_type) override; | |
| 23 void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override; | 21 void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override; |
| 24 void ProcessKeyEvent(std::unique_ptr<ui::Event> key_event, | 22 void ProcessKeyEvent(std::unique_ptr<ui::Event> key_event, |
| 25 const ProcessKeyEventCallback& callback) override; | 23 const ProcessKeyEventCallback& callback) override; |
| 26 void CancelComposition() override; | 24 void CancelComposition() override; |
| 27 | 25 |
| 28 private: | 26 private: |
| 29 std::unique_ptr<ui::TextInputClient> client_; | 27 std::unique_ptr<ui::TextInputClient> client_; |
| 30 std::unique_ptr<ui::InputMethodChromeOS> input_method_chromeos_; | 28 std::unique_ptr<ui::InputMethodChromeOS> input_method_chromeos_; |
| 31 | 29 |
| 32 DISALLOW_COPY_AND_ASSIGN(InputMethodBridge); | 30 DISALLOW_COPY_AND_ASSIGN(InputMethodBridge); |
| 33 }; | 31 }; |
| 34 | 32 |
| 35 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_ | 33 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_ |
| OLD | NEW |