| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/devtools/protocol/input_handler.h" | 5 #include "content/browser/devtools/protocol/input_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } | 317 } |
| 318 | 318 |
| 319 if (!host_ || !host_->GetRenderWidgetHost()) { | 319 if (!host_ || !host_->GetRenderWidgetHost()) { |
| 320 callback->sendFailure(Response::InternalError()); | 320 callback->sendFailure(Response::InternalError()); |
| 321 return; | 321 return; |
| 322 } | 322 } |
| 323 | 323 |
| 324 host_->GetRenderWidgetHost()->Focus(); | 324 host_->GetRenderWidgetHost()->Focus(); |
| 325 input_queued_ = false; | 325 input_queued_ = false; |
| 326 pending_key_callbacks_.push_back(std::move(callback)); | 326 pending_key_callbacks_.push_back(std::move(callback)); |
| 327 host_->GetRenderWidgetHost()->ForwardKeyboardEvent(event); | 327 host_->GetRenderWidgetHost()->ForwardKeyboardEventWithLatencyInfo( |
| 328 event, ui::LatencyInfo()); |
| 328 if (!input_queued_) { | 329 if (!input_queued_) { |
| 329 pending_key_callbacks_.back()->sendSuccess(); | 330 pending_key_callbacks_.back()->sendSuccess(); |
| 330 pending_key_callbacks_.pop_back(); | 331 pending_key_callbacks_.pop_back(); |
| 331 } | 332 } |
| 332 } | 333 } |
| 333 | 334 |
| 334 void InputHandler::DispatchMouseEvent( | 335 void InputHandler::DispatchMouseEvent( |
| 335 const std::string& type, | 336 const std::string& type, |
| 336 int x, | 337 int x, |
| 337 int y, | 338 int y, |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 for (auto& callback : pending_key_callbacks_) | 640 for (auto& callback : pending_key_callbacks_) |
| 640 callback->sendSuccess(); | 641 callback->sendSuccess(); |
| 641 pending_key_callbacks_.clear(); | 642 pending_key_callbacks_.clear(); |
| 642 for (auto& callback : pending_mouse_callbacks_) | 643 for (auto& callback : pending_mouse_callbacks_) |
| 643 callback->sendSuccess(); | 644 callback->sendSuccess(); |
| 644 pending_mouse_callbacks_.clear(); | 645 pending_mouse_callbacks_.clear(); |
| 645 } | 646 } |
| 646 | 647 |
| 647 } // namespace protocol | 648 } // namespace protocol |
| 648 } // namespace content | 649 } // namespace content |
| OLD | NEW |