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

Side by Side Diff: ui/aura/mus/input_method_mus.cc

Issue 2728373003: Fixs bug resulting in double event delivery in mus (Closed)
Patch Set: global disable Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « ui/aura/BUILD.gn ('k') | ui/aura/mus/input_method_mus_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/aura/BUILD.gn ('k') | ui/aura/mus/input_method_mus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698