| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 // Reduce number of log messages by logging each NOTIMPLEMENTED() only once. | 5 // Reduce number of log messages by logging each NOTIMPLEMENTED() only once. |
| 6 // This has to be before any other includes, else default is picked up. | 6 // This has to be before any other includes, else default is picked up. |
| 7 // See base/logging.h for details on this. | 7 // See base/logging.h for details on this. |
| 8 #define NOTIMPLEMENTED_POLICY 5 | 8 #define NOTIMPLEMENTED_POLICY 5 |
| 9 | 9 |
| 10 #include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h" | 10 #include "chrome/browser/ui/views/ime_driver/remote_text_input_client.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // TODO(moshayedi): crbug.com/631527. | 163 // TODO(moshayedi): crbug.com/631527. |
| 164 NOTIMPLEMENTED(); | 164 NOTIMPLEMENTED(); |
| 165 return false; | 165 return false; |
| 166 } | 166 } |
| 167 | 167 |
| 168 void RemoteTextInputClient::SetTextEditCommandForNextKeyEvent( | 168 void RemoteTextInputClient::SetTextEditCommandForNextKeyEvent( |
| 169 ui::TextEditCommand command) { | 169 ui::TextEditCommand command) { |
| 170 // TODO(moshayedi): crbug.com/631527. | 170 // TODO(moshayedi): crbug.com/631527. |
| 171 NOTIMPLEMENTED(); | 171 NOTIMPLEMENTED(); |
| 172 } | 172 } |
| 173 |
| 174 ui::EventDispatchDetails RemoteTextInputClient::DispatchKeyEventPostIME( |
| 175 ui::KeyEvent* event) { |
| 176 return DispatchKeyEventPostIME(event, nullptr); |
| 177 } |
| 178 |
| 179 ui::EventDispatchDetails RemoteTextInputClient::DispatchKeyEventPostIME( |
| 180 ui::KeyEvent* event, |
| 181 std::unique_ptr<base::Callback<void(bool)>> ack_callback) { |
| 182 pending_callbacks_.push_back(std::move(ack_callback)); |
| 183 remote_client_->DispatchKeyEventPostIME( |
| 184 ui::Event::Clone(*event), |
| 185 base::Bind(&RemoteTextInputClient::DispatchKeyEventPostIMECallback, |
| 186 base::Unretained(this))); |
| 187 return ui::EventDispatchDetails(); |
| 188 } |
| 189 |
| 190 void RemoteTextInputClient::DispatchKeyEventPostIMECallback( |
| 191 bool stopped_propagation) { |
| 192 DCHECK(!pending_callbacks_.empty()); |
| 193 std::unique_ptr<base::Callback<void(bool)>> ack_callback = |
| 194 std::move(pending_callbacks_.front()); |
| 195 pending_callbacks_.pop_front(); |
| 196 |
| 197 if (ack_callback) |
| 198 ack_callback->Run(stopped_propagation); |
| 199 } |
| OLD | NEW |