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

Unified Diff: services/ui/ime/test_ime_driver/test_ime_driver.cc

Issue 2412593002: IME for Mus: Send ack for key events after IME driver processes the event. (Closed)
Patch Set: Addressed feedback. Created 4 years, 2 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
« no previous file with comments | « services/ui/ime/ime_unittest.cc ('k') | services/ui/public/interfaces/ime.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ime/test_ime_driver/test_ime_driver.cc
diff --git a/services/ui/ime/test_ime_driver/test_ime_driver.cc b/services/ui/ime/test_ime_driver/test_ime_driver.cc
index 97aa702755192b7d43b3c4250efcdd2705e60522..3d47dc084f0f99bb36caabaf4bbe2f72290460ab 100644
--- a/services/ui/ime/test_ime_driver/test_ime_driver.cc
+++ b/services/ui/ime/test_ime_driver/test_ime_driver.cc
@@ -20,7 +20,8 @@ class TestInputMethod : public mojom::InputMethod {
void OnTextInputModeChanged(mojom::TextInputMode text_input_mode) override {}
void OnTextInputTypeChanged(mojom::TextInputType text_input_type) override {}
void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override {}
- void ProcessKeyEvent(std::unique_ptr<Event> key_event) override {
+ void ProcessKeyEvent(std::unique_ptr<Event> key_event,
+ const ProcessKeyEventCallback& callback) override {
DCHECK(key_event->IsKeyEvent());
if (key_event->AsKeyEvent()->is_char()) {
@@ -29,10 +30,11 @@ class TestInputMethod : public mojom::InputMethod {
composition_event->type = mojom::CompositionEventType::INSERT_CHAR;
composition_event->key_event = std::move(key_event);
client_->OnCompositionEvent(std::move(composition_event));
+ callback.Run(true);
} else {
- client_->OnUnhandledEvent(std::move(key_event));
+ callback.Run(false);
}
- };
+ }
void CancelComposition() override {}
mojom::TextInputClientPtr client_;
« no previous file with comments | « services/ui/ime/ime_unittest.cc ('k') | services/ui/public/interfaces/ime.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698