| 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 bool is_last_tap = i == *tap_count - 1; | 464 bool is_last_tap = i == *tap_count - 1; |
| 465 host_->QueueSyntheticGesture( | 465 host_->QueueSyntheticGesture( |
| 466 SyntheticGesture::Create(gesture_params), | 466 SyntheticGesture::Create(gesture_params), |
| 467 base::Bind(&InputHandler::SendSynthesizeTapGestureResponse, | 467 base::Bind(&InputHandler::SendSynthesizeTapGestureResponse, |
| 468 weak_factory_.GetWeakPtr(), command_id, is_last_tap)); | 468 weak_factory_.GetWeakPtr(), command_id, is_last_tap)); |
| 469 } | 469 } |
| 470 | 470 |
| 471 return Response::OK(); | 471 return Response::OK(); |
| 472 } | 472 } |
| 473 | 473 |
| 474 Response InputHandler::DispatchTouchEvent( |
| 475 const std::string& type, |
| 476 const std::vector<std::unique_ptr<base::DictionaryValue>>& touch_points, |
| 477 const int* modifiers, |
| 478 const double* timestamp) { |
| 479 return Response::FallThrough(); |
| 480 } |
| 481 |
| 474 void InputHandler::SendSynthesizePinchGestureResponse( | 482 void InputHandler::SendSynthesizePinchGestureResponse( |
| 475 DevToolsCommandId command_id, | 483 DevToolsCommandId command_id, |
| 476 SyntheticGesture::Result result) { | 484 SyntheticGesture::Result result) { |
| 477 if (result == SyntheticGesture::Result::GESTURE_FINISHED) { | 485 if (result == SyntheticGesture::Result::GESTURE_FINISHED) { |
| 478 client_->SendSynthesizePinchGestureResponse( | 486 client_->SendSynthesizePinchGestureResponse( |
| 479 command_id, SynthesizePinchGestureResponse::Create()); | 487 command_id, SynthesizePinchGestureResponse::Create()); |
| 480 } else { | 488 } else { |
| 481 client_->SendError(command_id, | 489 client_->SendError(command_id, |
| 482 Response::InternalError(base::StringPrintf( | 490 Response::InternalError(base::StringPrintf( |
| 483 "Synthetic pinch failed, result was %d", result))); | 491 "Synthetic pinch failed, result was %d", result))); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 509 } else { | 517 } else { |
| 510 client_->SendError(command_id, | 518 client_->SendError(command_id, |
| 511 Response::InternalError(base::StringPrintf( | 519 Response::InternalError(base::StringPrintf( |
| 512 "Synthetic tap failed, result was %d", result))); | 520 "Synthetic tap failed, result was %d", result))); |
| 513 } | 521 } |
| 514 } | 522 } |
| 515 | 523 |
| 516 } // namespace input | 524 } // namespace input |
| 517 } // namespace devtools | 525 } // namespace devtools |
| 518 } // namespace content | 526 } // namespace content |
| OLD | NEW |