| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "content/renderer/input/render_widget_input_handler.h" | 5 #include "content/renderer/input/render_widget_input_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 void RenderWidgetInputHandler::DidOverscrollFromBlink( | 507 void RenderWidgetInputHandler::DidOverscrollFromBlink( |
| 508 const WebFloatSize& overscrollDelta, | 508 const WebFloatSize& overscrollDelta, |
| 509 const WebFloatSize& accumulatedOverscroll, | 509 const WebFloatSize& accumulatedOverscroll, |
| 510 const WebFloatPoint& position, | 510 const WebFloatPoint& position, |
| 511 const WebFloatSize& velocity) { | 511 const WebFloatSize& velocity) { |
| 512 std::unique_ptr<DidOverscrollParams> params(new DidOverscrollParams()); | 512 std::unique_ptr<DidOverscrollParams> params(new DidOverscrollParams()); |
| 513 params->accumulated_overscroll = gfx::Vector2dF( | 513 params->accumulated_overscroll = gfx::Vector2dF( |
| 514 accumulatedOverscroll.width, accumulatedOverscroll.height); | 514 accumulatedOverscroll.width, accumulatedOverscroll.height); |
| 515 params->latest_overscroll_delta = | 515 params->latest_overscroll_delta = |
| 516 gfx::Vector2dF(overscrollDelta.width, overscrollDelta.height); | 516 gfx::Vector2dF(overscrollDelta.width, overscrollDelta.height); |
| 517 // TODO(sataya.m): don't negate velocity once http://crbug.com/499743 is | |
| 518 // fixed. | |
| 519 params->current_fling_velocity = | 517 params->current_fling_velocity = |
| 520 gfx::Vector2dF(-velocity.width, -velocity.height); | 518 gfx::Vector2dF(velocity.width, velocity.height); |
| 521 params->causal_event_viewport_point = gfx::PointF(position.x, position.y); | 519 params->causal_event_viewport_point = gfx::PointF(position.x, position.y); |
| 522 | 520 |
| 523 // If we're currently handling an event, stash the overscroll data such that | 521 // If we're currently handling an event, stash the overscroll data such that |
| 524 // it can be bundled in the event ack. | 522 // it can be bundled in the event ack. |
| 525 if (handling_event_overscroll_) { | 523 if (handling_event_overscroll_) { |
| 526 *handling_event_overscroll_ = std::move(params); | 524 *handling_event_overscroll_ = std::move(params); |
| 527 return; | 525 return; |
| 528 } | 526 } |
| 529 | 527 |
| 530 delegate_->OnDidOverscroll(*params); | 528 delegate_->OnDidOverscroll(*params); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 552 if (pending_input_event_ack_) { | 550 if (pending_input_event_ack_) { |
| 553 TRACE_EVENT_ASYNC_END0("input", | 551 TRACE_EVENT_ASYNC_END0("input", |
| 554 "RenderWidgetInputHandler::ThrottledInputEventAck", | 552 "RenderWidgetInputHandler::ThrottledInputEventAck", |
| 555 pending_input_event_ack_.get()); | 553 pending_input_event_ack_.get()); |
| 556 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); | 554 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); |
| 557 } | 555 } |
| 558 total_input_handling_time_this_frame_ = base::TimeDelta(); | 556 total_input_handling_time_this_frame_ = base::TimeDelta(); |
| 559 } | 557 } |
| 560 | 558 |
| 561 } // namespace content | 559 } // namespace content |
| OLD | NEW |