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_REMOTE_TEXT_INPUT_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_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/text_input_client.h" | 9 #include "ui/base/ime/text_input_client.h" |
10 | 10 |
11 // This implementation of ui::TextInputClient sends all updates via mojo IPC to | 11 // This implementation of ui::TextInputClient sends all updates via mojo IPC to |
12 // a remote client. This is intended to be passed to the overrides of | 12 // a remote client. This is intended to be passed to the overrides of |
13 // ui::InputMethod::SetFocusedTextInputClient(). | 13 // ui::InputMethod::SetFocusedTextInputClient(). |
14 class RemoteTextInputClient : public ui::TextInputClient { | 14 class RemoteTextInputClient : public ui::TextInputClient { |
15 public: | 15 public: |
16 RemoteTextInputClient(ui::mojom::TextInputClientPtr remote_client, | 16 explicit RemoteTextInputClient(ui::mojom::StartSessionDetailsPtr); |
17 ui::TextInputType text_input_type, | |
18 ui::TextInputMode text_input_mode, | |
19 base::i18n::TextDirection text_direction, | |
20 int text_input_flags, | |
21 gfx::Rect caret_bounds); | |
22 ~RemoteTextInputClient() override; | 17 ~RemoteTextInputClient() override; |
23 | 18 |
24 void SetTextInputType(ui::TextInputType text_input_type); | 19 void SetTextInputType(ui::TextInputType text_input_type); |
25 void SetCaretBounds(const gfx::Rect& caret_bounds); | 20 void SetCaretBounds(const gfx::Rect& caret_bounds); |
26 | 21 |
27 private: | 22 private: |
28 // ui::TextInputClient: | 23 // ui::TextInputClient: |
29 void SetCompositionText(const ui::CompositionText& composition) override; | 24 void SetCompositionText(const ui::CompositionText& composition) override; |
30 void ConfirmCompositionText() override; | 25 void ConfirmCompositionText() override; |
31 void ClearCompositionText() override; | 26 void ClearCompositionText() override; |
(...skipping 27 matching lines...) Expand all Loading... |
59 ui::TextInputType text_input_type_; | 54 ui::TextInputType text_input_type_; |
60 ui::TextInputMode text_input_mode_; | 55 ui::TextInputMode text_input_mode_; |
61 base::i18n::TextDirection text_direction_; | 56 base::i18n::TextDirection text_direction_; |
62 int text_input_flags_; | 57 int text_input_flags_; |
63 gfx::Rect caret_bounds_; | 58 gfx::Rect caret_bounds_; |
64 | 59 |
65 DISALLOW_COPY_AND_ASSIGN(RemoteTextInputClient); | 60 DISALLOW_COPY_AND_ASSIGN(RemoteTextInputClient); |
66 }; | 61 }; |
67 | 62 |
68 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_ | 63 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_ |
OLD | NEW |