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 explicit RemoteTextInputClient(ui::mojom::TextInputClientPtr remote_client); | 16 RemoteTextInputClient(ui::mojom::TextInputClientPtr remote_client, |
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); | |
Hadi
2017/01/13 21:47:53
We need these details to initialize RemoteTextInpu
| |
17 ~RemoteTextInputClient() override; | 22 ~RemoteTextInputClient() override; |
18 | 23 |
24 void SetTextInputType(ui::TextInputType text_input_type); | |
25 void SetCaretBounds(const gfx::Rect& caret_bounds); | |
26 | |
19 private: | 27 private: |
20 // ui::TextInputClient: | 28 // ui::TextInputClient: |
21 void SetCompositionText(const ui::CompositionText& composition) override; | 29 void SetCompositionText(const ui::CompositionText& composition) override; |
22 void ConfirmCompositionText() override; | 30 void ConfirmCompositionText() override; |
23 void ClearCompositionText() override; | 31 void ClearCompositionText() override; |
24 void InsertText(const base::string16& text) override; | 32 void InsertText(const base::string16& text) override; |
25 void InsertChar(const ui::KeyEvent& event) override; | 33 void InsertChar(const ui::KeyEvent& event) override; |
26 ui::TextInputType GetTextInputType() const override; | 34 ui::TextInputType GetTextInputType() const override; |
27 ui::TextInputMode GetTextInputMode() const override; | 35 ui::TextInputMode GetTextInputMode() const override; |
28 base::i18n::TextDirection GetTextDirection() const override; | 36 base::i18n::TextDirection GetTextDirection() const override; |
(...skipping 12 matching lines...) Expand all Loading... | |
41 base::string16* text) const override; | 49 base::string16* text) const override; |
42 void OnInputMethodChanged() override; | 50 void OnInputMethodChanged() override; |
43 bool ChangeTextDirectionAndLayoutAlignment( | 51 bool ChangeTextDirectionAndLayoutAlignment( |
44 base::i18n::TextDirection direction) override; | 52 base::i18n::TextDirection direction) override; |
45 void ExtendSelectionAndDelete(size_t before, size_t after) override; | 53 void ExtendSelectionAndDelete(size_t before, size_t after) override; |
46 void EnsureCaretNotInRect(const gfx::Rect& rect) override; | 54 void EnsureCaretNotInRect(const gfx::Rect& rect) override; |
47 bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override; | 55 bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override; |
48 void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override; | 56 void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override; |
49 | 57 |
50 ui::mojom::TextInputClientPtr remote_client_; | 58 ui::mojom::TextInputClientPtr remote_client_; |
59 ui::TextInputType text_input_type_; | |
60 ui::TextInputMode text_input_mode_; | |
61 base::i18n::TextDirection text_direction_; | |
62 int text_input_flags_; | |
63 gfx::Rect caret_bounds_; | |
51 | 64 |
52 DISALLOW_COPY_AND_ASSIGN(RemoteTextInputClient); | 65 DISALLOW_COPY_AND_ASSIGN(RemoteTextInputClient); |
53 }; | 66 }; |
54 | 67 |
55 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_ | 68 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_ |
OLD | NEW |