| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 // Virtual keyboard is not supported, so react to focus change immediately. | 478 // Virtual keyboard is not supported, so react to focus change immediately. |
| 479 if (processed != WebInputEventResult::NotHandled && | 479 if (processed != WebInputEventResult::NotHandled && |
| 480 (input_event.type == WebInputEvent::TouchEnd || | 480 (input_event.type == WebInputEvent::TouchEnd || |
| 481 input_event.type == WebInputEvent::MouseUp)) { | 481 input_event.type == WebInputEvent::MouseUp)) { |
| 482 delegate_->FocusChangeComplete(); | 482 delegate_->FocusChangeComplete(); |
| 483 } | 483 } |
| 484 #endif | 484 #endif |
| 485 } | 485 } |
| 486 | 486 |
| 487 void RenderWidgetInputHandler::DidOverscrollFromBlink( | 487 void RenderWidgetInputHandler::DidOverscrollFromBlink( |
| 488 const WebFloatSize& unusedDelta, | 488 const WebFloatSize& overscrollDelta, |
| 489 const WebFloatSize& accumulatedRootOverScroll, | 489 const WebFloatSize& accumulatedOverscroll, |
| 490 const WebFloatPoint& position, | 490 const WebFloatPoint& position, |
| 491 const WebFloatSize& velocity) { | 491 const WebFloatSize& velocity) { |
| 492 std::unique_ptr<DidOverscrollParams> params(new DidOverscrollParams()); | 492 std::unique_ptr<DidOverscrollParams> params(new DidOverscrollParams()); |
| 493 params->accumulated_overscroll = gfx::Vector2dF( | 493 params->accumulated_overscroll = gfx::Vector2dF( |
| 494 accumulatedRootOverScroll.width, accumulatedRootOverScroll.height); | 494 accumulatedOverscroll.width, accumulatedOverscroll.height); |
| 495 params->latest_overscroll_delta = | 495 params->latest_overscroll_delta = |
| 496 gfx::Vector2dF(unusedDelta.width, unusedDelta.height); | 496 gfx::Vector2dF(overscrollDelta.width, overscrollDelta.height); |
| 497 // TODO(sataya.m): don't negate velocity once http://crbug.com/499743 is | 497 // TODO(sataya.m): don't negate velocity once http://crbug.com/499743 is |
| 498 // fixed. | 498 // fixed. |
| 499 params->current_fling_velocity = | 499 params->current_fling_velocity = |
| 500 gfx::Vector2dF(-velocity.width, -velocity.height); | 500 gfx::Vector2dF(-velocity.width, -velocity.height); |
| 501 params->causal_event_viewport_point = gfx::PointF(position.x, position.y); | 501 params->causal_event_viewport_point = gfx::PointF(position.x, position.y); |
| 502 | 502 |
| 503 // If we're currently handling an event, stash the overscroll data such that | 503 // If we're currently handling an event, stash the overscroll data such that |
| 504 // it can be bundled in the event ack. | 504 // it can be bundled in the event ack. |
| 505 if (handling_event_overscroll_) { | 505 if (handling_event_overscroll_) { |
| 506 *handling_event_overscroll_ = std::move(params); | 506 *handling_event_overscroll_ = std::move(params); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 532 if (pending_input_event_ack_) { | 532 if (pending_input_event_ack_) { |
| 533 TRACE_EVENT_ASYNC_END0("input", | 533 TRACE_EVENT_ASYNC_END0("input", |
| 534 "RenderWidgetInputHandler::ThrottledInputEventAck", | 534 "RenderWidgetInputHandler::ThrottledInputEventAck", |
| 535 pending_input_event_ack_.get()); | 535 pending_input_event_ack_.get()); |
| 536 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); | 536 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); |
| 537 } | 537 } |
| 538 total_input_handling_time_this_frame_ = base::TimeDelta(); | 538 total_input_handling_time_this_frame_ = base::TimeDelta(); |
| 539 } | 539 } |
| 540 | 540 |
| 541 } // namespace content | 541 } // namespace content |
| OLD | NEW |