| 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_SIMPLE_INPUT_METHOD_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_IME_DRIVER_SIMPLE_INPUT_METHOD_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_SIMPLE_INPUT_METHOD_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_SIMPLE_INPUT_METHOD_H_ |
| 7 | 7 |
| 8 #include "services/ui/public/interfaces/ime/ime.mojom.h" | 8 #include "services/ui/public/interfaces/ime/ime.mojom.h" |
| 9 | 9 |
| 10 // This is to be used on platforms where a proper implementation of | 10 // This is to be used on platforms where a proper implementation of |
| 11 // ui::mojom::InputMethod is missing. It doesn't handle any events and calls | 11 // ui::mojom::InputMethod is missing. It doesn't handle any events and calls |
| 12 // the callback with false, which will result in client code handling events | 12 // the callback with false, which will result in client code handling events |
| 13 // locally. | 13 // locally. |
| 14 class SimpleInputMethod : public ui::mojom::InputMethod { | 14 class SimpleInputMethod : public ui::mojom::InputMethod { |
| 15 public: | 15 public: |
| 16 SimpleInputMethod(); | 16 SimpleInputMethod(); |
| 17 ~SimpleInputMethod() override; | 17 ~SimpleInputMethod() override; |
| 18 | 18 |
| 19 // ui::mojom::InputMethod: | 19 // ui::mojom::InputMethod: |
| 20 void OnTextInputModeChanged( | 20 void OnTextInputModeChanged(ui::TextInputMode text_input_mode) override; |
| 21 ui::mojom::TextInputMode text_input_mode) override; | 21 void OnTextInputTypeChanged(ui::TextInputType text_input_type) override; |
| 22 void OnTextInputTypeChanged( | |
| 23 ui::mojom::TextInputType text_input_type) override; | |
| 24 void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override; | 22 void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override; |
| 25 void ProcessKeyEvent(std::unique_ptr<ui::Event> key_event, | 23 void ProcessKeyEvent(std::unique_ptr<ui::Event> key_event, |
| 26 const ProcessKeyEventCallback& callback) override; | 24 const ProcessKeyEventCallback& callback) override; |
| 27 void CancelComposition() override; | 25 void CancelComposition() override; |
| 28 | 26 |
| 29 private: | 27 private: |
| 30 DISALLOW_COPY_AND_ASSIGN(SimpleInputMethod); | 28 DISALLOW_COPY_AND_ASSIGN(SimpleInputMethod); |
| 31 }; | 29 }; |
| 32 | 30 |
| 33 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_SIMPLE_INPUT_METHOD_H_ | 31 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_SIMPLE_INPUT_METHOD_H_ |
| OLD | NEW |