Chromium Code Reviews| Index: chrome/browser/ui/views/ime_driver/remote_text_input_client.cc |
| diff --git a/chrome/browser/ui/views/ime_driver/remote_text_input_client.cc b/chrome/browser/ui/views/ime_driver/remote_text_input_client.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..66595c382f24ece22f7092385a26c6f64be165fa |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/ime_driver/remote_text_input_client.cc |
| @@ -0,0 +1,158 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h" |
| + |
| +#include "base/strings/utf_string_conversions.h" |
| + |
| +RemoteTextInputClient::RemoteTextInputClient( |
| + ui::mojom::TextInputClientPtr remote_client) |
| + : remote_client_(std::move(remote_client)) {} |
| + |
| +RemoteTextInputClient::~RemoteTextInputClient() {} |
| + |
| +void RemoteTextInputClient::SetCompositionText( |
| + const ui::CompositionText& composition) { |
| + remote_client_->SetCompositionText(composition); |
| +} |
| + |
| +void RemoteTextInputClient::ConfirmCompositionText() { |
| + remote_client_->ConfirmCompositionText(); |
| +} |
| + |
| +void RemoteTextInputClient::ClearCompositionText() { |
| + remote_client_->ClearCompositionText(); |
| +} |
| + |
| +void RemoteTextInputClient::InsertText(const base::string16& text) { |
| + remote_client_->InsertText(base::UTF16ToUTF8(text)); |
| +} |
| + |
| +void RemoteTextInputClient::InsertChar(const ui::KeyEvent& event) { |
| + remote_client_->InsertChar(ui::Event::Clone(event)); |
| +} |
| + |
| +ui::TextInputType RemoteTextInputClient::GetTextInputType() const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return ui::TEXT_INPUT_TYPE_TEXT; |
| +} |
| + |
| +ui::TextInputMode RemoteTextInputClient::GetTextInputMode() const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return ui::TEXT_INPUT_MODE_DEFAULT; |
| +} |
| + |
| +base::i18n::TextDirection RemoteTextInputClient::GetTextDirection() const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
|
sky
2016/12/12 02:16:21
Are these going to be spammy? Can you define NOTIM
Hadi
2016/12/12 16:04:58
Done.
|
| + return base::i18n::UNKNOWN_DIRECTION; |
| +} |
| + |
| +int RemoteTextInputClient::GetTextInputFlags() const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return 0; |
| +} |
| + |
| +bool RemoteTextInputClient::CanComposeInline() const { |
| + // If we return false here, ui::InputMethodChromeOS will try to create a |
| + // composition window. But here we are at IMEDriver, and composition |
| + // window shouldn't be created by IMEDriver. |
| + return true; |
| +} |
| + |
| +gfx::Rect RemoteTextInputClient::GetCaretBounds() const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return gfx::Rect(); |
| +} |
| + |
| +bool RemoteTextInputClient::GetCompositionCharacterBounds( |
| + uint32_t index, |
| + gfx::Rect* rect) const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +bool RemoteTextInputClient::HasCompositionText() const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +bool RemoteTextInputClient::GetTextRange(gfx::Range* range) const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +bool RemoteTextInputClient::GetCompositionTextRange(gfx::Range* range) const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +bool RemoteTextInputClient::GetSelectionRange(gfx::Range* range) const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +bool RemoteTextInputClient::SetSelectionRange(const gfx::Range& range) { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +bool RemoteTextInputClient::DeleteRange(const gfx::Range& range) { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +bool RemoteTextInputClient::GetTextFromRange(const gfx::Range& range, |
| + base::string16* text) const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +void RemoteTextInputClient::OnInputMethodChanged() { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +bool RemoteTextInputClient::ChangeTextDirectionAndLayoutAlignment( |
| + base::i18n::TextDirection direction) { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +void RemoteTextInputClient::ExtendSelectionAndDelete(size_t before, |
| + size_t after) { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void RemoteTextInputClient::EnsureCaretInRect(const gfx::Rect& rect) { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +bool RemoteTextInputClient::IsTextEditCommandEnabled( |
| + ui::TextEditCommand command) const { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +void RemoteTextInputClient::SetTextEditCommandForNextKeyEvent( |
| + ui::TextEditCommand command) { |
| + // TODO(moshayedi): crbug.com/631527. |
| + NOTIMPLEMENTED(); |
| +} |