| 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(ui::TextInputMode text_input_mode) override; | |
| 20 void OnTextInputTypeChanged(ui::TextInputType text_input_type) override; | 19 void OnTextInputTypeChanged(ui::TextInputType text_input_type) override; |
| 21 void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override; | 20 void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override; |
| 22 void ProcessKeyEvent(std::unique_ptr<ui::Event> key_event, | 21 void ProcessKeyEvent(std::unique_ptr<ui::Event> key_event, |
| 23 const ProcessKeyEventCallback& callback) override; | 22 const ProcessKeyEventCallback& callback) override; |
| 24 void CancelComposition() override; | 23 void CancelComposition() override; |
| 25 | 24 |
| 26 private: | 25 private: |
| 27 std::unique_ptr<ui::TextInputClient> client_; | 26 std::unique_ptr<ui::TextInputClient> client_; |
| 28 std::unique_ptr<ui::InputMethodChromeOS> input_method_chromeos_; | 27 std::unique_ptr<ui::InputMethodChromeOS> input_method_chromeos_; |
| 29 | 28 |
| 30 DISALLOW_COPY_AND_ASSIGN(InputMethodBridge); | 29 DISALLOW_COPY_AND_ASSIGN(InputMethodBridge); |
| 31 }; | 30 }; |
| 32 | 31 |
| 33 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_ | 32 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_INPUT_METHOD_BRIDGE_CHROMEOS_H_ |
| OLD | NEW |