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