| 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 } | 316 } |
| 317 | 317 |
| 318 if (!host_ || !host_->GetRenderWidgetHost()) { | 318 if (!host_ || !host_->GetRenderWidgetHost()) { |
| 319 callback->sendFailure(Response::InternalError()); | 319 callback->sendFailure(Response::InternalError()); |
| 320 return; | 320 return; |
| 321 } | 321 } |
| 322 | 322 |
| 323 host_->GetRenderWidgetHost()->Focus(); | 323 host_->GetRenderWidgetHost()->Focus(); |
| 324 input_queued_ = false; | 324 input_queued_ = false; |
| 325 pending_key_callbacks_.push_back(std::move(callback)); | 325 pending_key_callbacks_.push_back(std::move(callback)); |
| 326 host_->GetRenderWidgetHost()->ForwardKeyboardEvent(event); | 326 host_->GetRenderWidgetHost()->ForwardKeyboardEventWithLatencyInfo( |
| 327 event, ui::LatencyInfo()); |
| 327 if (!input_queued_) { | 328 if (!input_queued_) { |
| 328 pending_key_callbacks_.back()->sendSuccess(); | 329 pending_key_callbacks_.back()->sendSuccess(); |
| 329 pending_key_callbacks_.pop_back(); | 330 pending_key_callbacks_.pop_back(); |
| 330 } | 331 } |
| 331 } | 332 } |
| 332 | 333 |
| 333 void InputHandler::DispatchMouseEvent( | 334 void InputHandler::DispatchMouseEvent( |
| 334 const std::string& type, | 335 const std::string& type, |
| 335 int x, | 336 int x, |
| 336 int y, | 337 int y, |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 for (auto& callback : pending_key_callbacks_) | 641 for (auto& callback : pending_key_callbacks_) |
| 641 callback->sendSuccess(); | 642 callback->sendSuccess(); |
| 642 pending_key_callbacks_.clear(); | 643 pending_key_callbacks_.clear(); |
| 643 for (auto& callback : pending_mouse_callbacks_) | 644 for (auto& callback : pending_mouse_callbacks_) |
| 644 callback->sendSuccess(); | 645 callback->sendSuccess(); |
| 645 pending_mouse_callbacks_.clear(); | 646 pending_mouse_callbacks_.clear(); |
| 646 } | 647 } |
| 647 | 648 |
| 648 } // namespace protocol | 649 } // namespace protocol |
| 649 } // namespace content | 650 } // namespace content |
| OLD | NEW |