Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8696)

Unified Diff: chrome/browser/ui/views/ime_driver/remote_text_input_client.h

Issue 2957173004: Make DispatchKeyEventPostIME() asynchronous.
Patch Set: cleanup. Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/ime_driver/remote_text_input_client.h
diff --git a/chrome/browser/ui/views/ime_driver/remote_text_input_client.h b/chrome/browser/ui/views/ime_driver/remote_text_input_client.h
index 18ef7be44e7376f12404c3a30fbe27c0c7be9cfa..925c4617602fc426b7dc1ecfb9bcb6011fb3adf8 100644
--- a/chrome/browser/ui/views/ime_driver/remote_text_input_client.h
+++ b/chrome/browser/ui/views/ime_driver/remote_text_input_client.h
@@ -6,12 +6,14 @@
#define CHROME_BROWSER_UI_VIEWS_IME_DRIVER_REMOTE_TEXT_INPUT_CLIENT_H_
#include "services/ui/public/interfaces/ime/ime.mojom.h"
+#include "ui/base/ime/input_method_delegate.h"
#include "ui/base/ime/text_input_client.h"
// This implementation of ui::TextInputClient sends all updates via mojo IPC to
// a remote client. This is intended to be passed to the overrides of
// ui::InputMethod::SetFocusedTextInputClient().
-class RemoteTextInputClient : public ui::TextInputClient {
+class RemoteTextInputClient : public ui::TextInputClient,
+ public ui::internal::InputMethodDelegate {
public:
RemoteTextInputClient(ui::mojom::TextInputClientPtr remote_client,
ui::TextInputType text_input_type,
@@ -55,12 +57,22 @@ class RemoteTextInputClient : public ui::TextInputClient {
bool IsTextEditCommandEnabled(ui::TextEditCommand command) const override;
void SetTextEditCommandForNextKeyEvent(ui::TextEditCommand command) override;
+ // ui::internal::InputMethodDelegate:
+ ui::EventDispatchDetails DispatchKeyEventPostIME(
+ ui::KeyEvent* event) override;
+ ui::EventDispatchDetails DispatchKeyEventPostIME(
+ ui::KeyEvent* key_event,
+ std::unique_ptr<base::Callback<void(bool)>> ack_callback) override;
+
+ void DispatchKeyEventPostIMECallback(bool stopped_propagation);
+
ui::mojom::TextInputClientPtr remote_client_;
ui::TextInputType text_input_type_;
ui::TextInputMode text_input_mode_;
base::i18n::TextDirection text_direction_;
int text_input_flags_;
gfx::Rect caret_bounds_;
+ std::deque<std::unique_ptr<base::Callback<void(bool)>>> pending_callbacks_;
DISALLOW_COPY_AND_ASSIGN(RemoteTextInputClient);
};

Powered by Google App Engine
This is Rietveld 408576698