Chromium Code Reviews| 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 | 517 // TODO(sataya.m): don't negate velocity once http://crbug.com/499743 is |
|
dtapuska
2016/08/29 21:16:34
Do we need to remove this comment? Is this partial
majidvp
2016/08/31 19:39:40
Overscroll glow logic expects to receive delta and
bokan
2016/08/31 21:04:30
Yes, I believe that's correct.
| |
| 518 // fixed. | 518 // fixed. |
| 519 params->current_fling_velocity = | 519 params->current_fling_velocity = |
| 520 gfx::Vector2dF(-velocity.width, -velocity.height); | 520 gfx::Vector2dF(velocity.width, velocity.height); |
| 521 params->causal_event_viewport_point = gfx::PointF(position.x, position.y); | 521 params->causal_event_viewport_point = gfx::PointF(position.x, position.y); |
| 522 | 522 |
| 523 // If we're currently handling an event, stash the overscroll data such that | 523 // If we're currently handling an event, stash the overscroll data such that |
| 524 // it can be bundled in the event ack. | 524 // it can be bundled in the event ack. |
| 525 if (handling_event_overscroll_) { | 525 if (handling_event_overscroll_) { |
| 526 *handling_event_overscroll_ = std::move(params); | 526 *handling_event_overscroll_ = std::move(params); |
| 527 return; | 527 return; |
| 528 } | 528 } |
| 529 | 529 |
| 530 delegate_->OnDidOverscroll(*params); | 530 delegate_->OnDidOverscroll(*params); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 552 if (pending_input_event_ack_) { | 552 if (pending_input_event_ack_) { |
| 553 TRACE_EVENT_ASYNC_END0("input", | 553 TRACE_EVENT_ASYNC_END0("input", |
| 554 "RenderWidgetInputHandler::ThrottledInputEventAck", | 554 "RenderWidgetInputHandler::ThrottledInputEventAck", |
| 555 pending_input_event_ack_.get()); | 555 pending_input_event_ack_.get()); |
| 556 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); | 556 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); |
| 557 } | 557 } |
| 558 total_input_handling_time_this_frame_ = base::TimeDelta(); | 558 total_input_handling_time_this_frame_ = base::TimeDelta(); |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace content | 561 } // namespace content |
| OLD | NEW |