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_REMOTE_TEXT_INPUT_CLIENT_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_ |
| 7 |
| 8 #include "services/ui/public/interfaces/ime/ime.mojom.h" |
| 9 #include "ui/base/ime/text_input_client.h" |
| 10 |
| 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 |
| 13 // ui::InputMethod::SetFocusedTextInputClient(). |
| 14 class RemoteTextInputClient : public ui::TextInputClient { |
| 15 public: |
| 16 explicit RemoteTextInputClient(ui::mojom::TextInputClientPtr remote_client); |
| 17 ~RemoteTextInputClient() override; |
| 18 |
| 19 private: |
| 20 // ui::TextInputClient: |
| 21 void SetCompositionText(const ui::CompositionText& composition) override; |
| 22 void ConfirmCompositionText() override; |
| 23 void ClearCompositionText() override; |
| 24 void InsertText(const base::string16& text) override; |
| 25 void InsertChar(const ui::KeyEvent& event) override; |
| 26 ui::TextInputType GetTextInputType() const override; |
| 27 ui::TextInputMode GetTextInputMode() const override; |
| 28 base::i18n::TextDirection GetTextDirection() const override; |
| 29 int GetTextInputFlags() const override; |
| 30 bool CanComposeInline() const override; |
| 31 gfx::Rect GetCaretBounds() const override; |
| 32 bool GetCompositionCharacterBounds(uint32_t index, |
| 33 gfx::Rect* rect) const override; |
| 34 bool HasCompositionText() const override; |
| 35 bool GetTextRange(gfx::Range* range) const override; |
| 36 bool GetCompositionTextRange(gfx::Range* range) const override; |
| 37 bool GetSelectionRange(gfx::Range* range) const override; |
| 38 bool SetSelectionRange(const gfx::Range& range) override; |
| 39 bool DeleteRange(const gfx::Range& range) override; |
| 40 bool GetTextFromRange(const gfx::Range& range, |
| 41 base::string16* text) const override; |
| 42 void OnInputMethodChanged() override; |
| 43 bool ChangeTextDirectionAndLayoutAlignment( |
| 44 base::i18n::TextDirection direction) override; |
| 45 void ExtendSelectionAndDelete(size_t before, size_t after) override; |
| 46 void EnsureCaretNotInRect(const gfx::Rect& rect) override; |
| 47 bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override; |
| 48 void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override; |
| 49 |
| 50 ui::mojom::TextInputClientPtr remote_client_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(RemoteTextInputClient); |
| 53 }; |
| 54 |
| 55 #endif // CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_ |
OLD | NEW |