| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/aura/mus/input_method_mus.h" | 5 #include "ui/aura/mus/input_method_mus.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "services/ui/public/interfaces/constants.mojom.h" | 10 #include "services/ui/public/interfaces/constants.mojom.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 bool InputMethodMus::OnUntranslatedIMEMessage(const base::NativeEvent& event, | 81 bool InputMethodMus::OnUntranslatedIMEMessage(const base::NativeEvent& event, |
| 82 NativeEventResult* result) { | 82 NativeEventResult* result) { |
| 83 // This method is not called on non-Windows platforms. See the comments for | 83 // This method is not called on non-Windows platforms. See the comments for |
| 84 // ui::InputMethod::OnUntranslatedIMEMessage(). | 84 // ui::InputMethod::OnUntranslatedIMEMessage(). |
| 85 return false; | 85 return false; |
| 86 } | 86 } |
| 87 | 87 |
| 88 void InputMethodMus::DispatchKeyEvent(ui::KeyEvent* event) { | 88 void InputMethodMus::DispatchKeyEvent(ui::KeyEvent* event) { |
| 89 DispatchKeyEvent(event, nullptr); | 89 DispatchKeyEvent(event, nullptr); |
| 90 // Mark the event as handled so that EventGenerator doesn't attempt to |
| 91 // deliver event as well. |
| 92 event->SetHandled(); |
| 90 } | 93 } |
| 91 | 94 |
| 92 void InputMethodMus::OnTextInputTypeChanged(const ui::TextInputClient* client) { | 95 void InputMethodMus::OnTextInputTypeChanged(const ui::TextInputClient* client) { |
| 93 if (IsTextInputClientFocused(client)) | 96 if (IsTextInputClientFocused(client)) |
| 94 UpdateTextInputType(); | 97 UpdateTextInputType(); |
| 95 InputMethodBase::OnTextInputTypeChanged(client); | 98 InputMethodBase::OnTextInputTypeChanged(client); |
| 96 | 99 |
| 97 if (input_method_) | 100 if (input_method_) |
| 98 input_method_->OnTextInputTypeChanged(client->GetTextInputType()); | 101 input_method_->OnTextInputTypeChanged(client->GetTextInputType()); |
| 99 } | 102 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 std::move(pending_callbacks_.front()); | 201 std::move(pending_callbacks_.front()); |
| 199 pending_callbacks_.pop_front(); | 202 pending_callbacks_.pop_front(); |
| 200 // |ack_callback| can be null if the standard form of DispatchKeyEvent() is | 203 // |ack_callback| can be null if the standard form of DispatchKeyEvent() is |
| 201 // called instead of the version which provides a callback. In mus+ash we | 204 // called instead of the version which provides a callback. In mus+ash we |
| 202 // use the version with callback, but some unittests use the standard form. | 205 // use the version with callback, but some unittests use the standard form. |
| 203 if (ack_callback) | 206 if (ack_callback) |
| 204 ack_callback->Run(event_result); | 207 ack_callback->Run(event_result); |
| 205 } | 208 } |
| 206 | 209 |
| 207 } // namespace aura | 210 } // namespace aura |
| OLD | NEW |