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 // Reduce number of log messages by logging each NOTIMPLEMENTED() only once. |
| 6 // This has to be before any other includes, else default is picked up. |
| 7 // See base/logging.h for details on this. |
| 8 #define NOTIMPLEMENTED_POLICY 5 |
| 9 |
| 10 #include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h" |
| 11 |
| 12 #include "base/strings/utf_string_conversions.h" |
| 13 |
| 14 RemoteTextInputClient::RemoteTextInputClient( |
| 15 ui::mojom::TextInputClientPtr remote_client) |
| 16 : remote_client_(std::move(remote_client)) {} |
| 17 |
| 18 RemoteTextInputClient::~RemoteTextInputClient() {} |
| 19 |
| 20 void RemoteTextInputClient::SetCompositionText( |
| 21 const ui::CompositionText& composition) { |
| 22 remote_client_->SetCompositionText(composition); |
| 23 } |
| 24 |
| 25 void RemoteTextInputClient::ConfirmCompositionText() { |
| 26 remote_client_->ConfirmCompositionText(); |
| 27 } |
| 28 |
| 29 void RemoteTextInputClient::ClearCompositionText() { |
| 30 remote_client_->ClearCompositionText(); |
| 31 } |
| 32 |
| 33 void RemoteTextInputClient::InsertText(const base::string16& text) { |
| 34 remote_client_->InsertText(base::UTF16ToUTF8(text)); |
| 35 } |
| 36 |
| 37 void RemoteTextInputClient::InsertChar(const ui::KeyEvent& event) { |
| 38 remote_client_->InsertChar(ui::Event::Clone(event)); |
| 39 } |
| 40 |
| 41 ui::TextInputType RemoteTextInputClient::GetTextInputType() const { |
| 42 // TODO(moshayedi): crbug.com/631527. |
| 43 NOTIMPLEMENTED(); |
| 44 return ui::TEXT_INPUT_TYPE_TEXT; |
| 45 } |
| 46 |
| 47 ui::TextInputMode RemoteTextInputClient::GetTextInputMode() const { |
| 48 // TODO(moshayedi): crbug.com/631527. |
| 49 NOTIMPLEMENTED(); |
| 50 return ui::TEXT_INPUT_MODE_DEFAULT; |
| 51 } |
| 52 |
| 53 base::i18n::TextDirection RemoteTextInputClient::GetTextDirection() const { |
| 54 // TODO(moshayedi): crbug.com/631527. |
| 55 NOTIMPLEMENTED(); |
| 56 return base::i18n::UNKNOWN_DIRECTION; |
| 57 } |
| 58 |
| 59 int RemoteTextInputClient::GetTextInputFlags() const { |
| 60 // TODO(moshayedi): crbug.com/631527. |
| 61 NOTIMPLEMENTED(); |
| 62 return 0; |
| 63 } |
| 64 |
| 65 bool RemoteTextInputClient::CanComposeInline() const { |
| 66 // If we return false here, ui::InputMethodChromeOS will try to create a |
| 67 // composition window. But here we are at IMEDriver, and composition |
| 68 // window shouldn't be created by IMEDriver. |
| 69 return true; |
| 70 } |
| 71 |
| 72 gfx::Rect RemoteTextInputClient::GetCaretBounds() const { |
| 73 // TODO(moshayedi): crbug.com/631527. |
| 74 NOTIMPLEMENTED(); |
| 75 return gfx::Rect(); |
| 76 } |
| 77 |
| 78 bool RemoteTextInputClient::GetCompositionCharacterBounds( |
| 79 uint32_t index, |
| 80 gfx::Rect* rect) const { |
| 81 // TODO(moshayedi): crbug.com/631527. |
| 82 NOTIMPLEMENTED(); |
| 83 return false; |
| 84 } |
| 85 |
| 86 bool RemoteTextInputClient::HasCompositionText() const { |
| 87 // TODO(moshayedi): crbug.com/631527. |
| 88 NOTIMPLEMENTED(); |
| 89 return false; |
| 90 } |
| 91 |
| 92 bool RemoteTextInputClient::GetTextRange(gfx::Range* range) const { |
| 93 // TODO(moshayedi): crbug.com/631527. |
| 94 NOTIMPLEMENTED(); |
| 95 return false; |
| 96 } |
| 97 |
| 98 bool RemoteTextInputClient::GetCompositionTextRange(gfx::Range* range) const { |
| 99 // TODO(moshayedi): crbug.com/631527. |
| 100 NOTIMPLEMENTED(); |
| 101 return false; |
| 102 } |
| 103 |
| 104 bool RemoteTextInputClient::GetSelectionRange(gfx::Range* range) const { |
| 105 // TODO(moshayedi): crbug.com/631527. |
| 106 NOTIMPLEMENTED(); |
| 107 return false; |
| 108 } |
| 109 |
| 110 bool RemoteTextInputClient::SetSelectionRange(const gfx::Range& range) { |
| 111 // TODO(moshayedi): crbug.com/631527. |
| 112 NOTIMPLEMENTED(); |
| 113 return false; |
| 114 } |
| 115 |
| 116 bool RemoteTextInputClient::DeleteRange(const gfx::Range& range) { |
| 117 // TODO(moshayedi): crbug.com/631527. |
| 118 NOTIMPLEMENTED(); |
| 119 return false; |
| 120 } |
| 121 |
| 122 bool RemoteTextInputClient::GetTextFromRange(const gfx::Range& range, |
| 123 base::string16* text) const { |
| 124 // TODO(moshayedi): crbug.com/631527. |
| 125 NOTIMPLEMENTED(); |
| 126 return false; |
| 127 } |
| 128 |
| 129 void RemoteTextInputClient::OnInputMethodChanged() { |
| 130 // TODO(moshayedi): crbug.com/631527. |
| 131 NOTIMPLEMENTED(); |
| 132 } |
| 133 |
| 134 bool RemoteTextInputClient::ChangeTextDirectionAndLayoutAlignment( |
| 135 base::i18n::TextDirection direction) { |
| 136 // TODO(moshayedi): crbug.com/631527. |
| 137 NOTIMPLEMENTED(); |
| 138 return false; |
| 139 } |
| 140 |
| 141 void RemoteTextInputClient::ExtendSelectionAndDelete(size_t before, |
| 142 size_t after) { |
| 143 // TODO(moshayedi): crbug.com/631527. |
| 144 NOTIMPLEMENTED(); |
| 145 } |
| 146 |
| 147 void RemoteTextInputClient::EnsureCaretNotInRect(const gfx::Rect& rect) { |
| 148 // TODO(moshayedi): crbug.com/631527. |
| 149 NOTIMPLEMENTED(); |
| 150 } |
| 151 |
| 152 bool RemoteTextInputClient::IsTextEditCommandEnabled( |
| 153 ui::TextEditCommand command) const { |
| 154 // TODO(moshayedi): crbug.com/631527. |
| 155 NOTIMPLEMENTED(); |
| 156 return false; |
| 157 } |
| 158 |
| 159 void RemoteTextInputClient::SetTextEditCommandForNextKeyEvent( |
| 160 ui::TextEditCommand command) { |
| 161 // TODO(moshayedi): crbug.com/631527. |
| 162 NOTIMPLEMENTED(); |
| 163 } |
OLD | NEW |