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

Unified Diff: ui/aura/mus/input_method_mus.cc

Issue 2831583005: Enable Config::MUS to use classic IME instead of servicified IME. (Closed)
Patch Set: Fix compile errors in non ChromeOS. Created 3 years, 8 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: ui/aura/mus/input_method_mus.cc
diff --git a/ui/aura/mus/input_method_mus.cc b/ui/aura/mus/input_method_mus.cc
index c67c2228856e50ebafc545105de9f43de899ebb0..97643b0f47629b043705c3ac881b09992c9dedf1 100644
--- a/ui/aura/mus/input_method_mus.cc
+++ b/ui/aura/mus/input_method_mus.cc
@@ -45,17 +45,15 @@ void InputMethodMus::Init(service_manager::Connector* connector) {
void InputMethodMus::DispatchKeyEvent(
ui::KeyEvent* event,
- std::unique_ptr<EventResultCallback> ack_callback) {
+ std::unique_ptr<AckCallback> ack_callback) {
DCHECK(event->type() == ui::ET_KEY_PRESSED ||
event->type() == ui::ET_KEY_RELEASED);
// If no text input client, do nothing.
if (!GetTextInputClient()) {
DispatchKeyEventPostIME(event);
- if (ack_callback) {
- ack_callback->Run(event->handled() ? EventResult::HANDLED
- : EventResult::UNHANDLED);
- }
+ if (ack_callback)
+ ack_callback->Run(event->handled());
return;
}
@@ -121,7 +119,7 @@ bool InputMethodMus::IsCandidatePopupOpen() const {
void InputMethodMus::SendKeyEventToInputMethod(
const ui::KeyEvent& event,
- std::unique_ptr<EventResultCallback> ack_callback) {
+ std::unique_ptr<AckCallback> ack_callback) {
if (!input_method_) {
// This code path is hit in tests that don't connect to the server.
DCHECK(!ack_callback);
@@ -187,7 +185,7 @@ void InputMethodMus::UpdateTextInputType() {
void InputMethodMus::AckPendingCallbacksUnhandled() {
for (auto& callback_ptr : pending_callbacks_) {
if (callback_ptr)
- callback_ptr->Run(EventResult::UNHANDLED);
+ callback_ptr->Run(false);
}
pending_callbacks_.clear();
}
@@ -198,20 +196,17 @@ void InputMethodMus::ProcessKeyEventCallback(
// Remove the callback as DispatchKeyEventPostIME() may lead to calling
// AckPendingCallbacksUnhandled(), which mutates |pending_callbacks_|.
DCHECK(!pending_callbacks_.empty());
- std::unique_ptr<EventResultCallback> ack_callback =
+ std::unique_ptr<AckCallback> ack_callback =
std::move(pending_callbacks_.front());
pending_callbacks_.pop_front();
- EventResult event_result;
+ bool event_result = handled;
if (!handled) {
// If not handled by IME, try dispatching the event to delegate to see if
// any client-side post-ime processing needs to be done. This includes cases
// like backspace, return key, etc.
std::unique_ptr<ui::Event> event_clone = ui::Event::Clone(event);
DispatchKeyEventPostIME(event_clone->AsKeyEvent());
- event_result =
- event_clone->handled() ? EventResult::HANDLED : EventResult::UNHANDLED;
- } else {
- event_result = EventResult::HANDLED;
+ event_result = event_clone->handled();
}
// |ack_callback| can be null if the standard form of DispatchKeyEvent() is
// called instead of the version which provides a callback. In mus+ash we

Powered by Google App Engine
This is Rietveld 408576698