OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2221 const blink::WebFloatSize& accumulatedRootOverScroll, | 2221 const blink::WebFloatSize& accumulatedRootOverScroll, |
2222 const blink::WebFloatPoint& position, | 2222 const blink::WebFloatPoint& position, |
2223 const blink::WebFloatSize& velocity) { | 2223 const blink::WebFloatSize& velocity) { |
2224 DidOverscrollParams params; | 2224 DidOverscrollParams params; |
2225 // TODO(jdduke): Consider bundling the overscroll with the input event ack to | 2225 // TODO(jdduke): Consider bundling the overscroll with the input event ack to |
2226 // save an IPC. | 2226 // save an IPC. |
2227 params.accumulated_overscroll = gfx::Vector2dF( | 2227 params.accumulated_overscroll = gfx::Vector2dF( |
2228 accumulatedRootOverScroll.width, accumulatedRootOverScroll.height); | 2228 accumulatedRootOverScroll.width, accumulatedRootOverScroll.height); |
2229 params.latest_overscroll_delta = | 2229 params.latest_overscroll_delta = |
2230 gfx::Vector2dF(unusedDelta.width, unusedDelta.height); | 2230 gfx::Vector2dF(unusedDelta.width, unusedDelta.height); |
| 2231 // TODO(sataya.m): don't negate velocity once http://crbug.com/499743 is |
| 2232 // fixed. |
2231 params.current_fling_velocity = | 2233 params.current_fling_velocity = |
2232 gfx::Vector2dF(velocity.width, velocity.height); | 2234 gfx::Vector2dF(-velocity.width, -velocity.height); |
2233 params.causal_event_viewport_point = gfx::PointF(position.x, position.y); | 2235 params.causal_event_viewport_point = gfx::PointF(position.x, position.y); |
2234 Send(new InputHostMsg_DidOverscroll(routing_id_, params)); | 2236 Send(new InputHostMsg_DidOverscroll(routing_id_, params)); |
2235 } | 2237 } |
2236 | 2238 |
2237 void RenderWidget::StartCompositor() { | 2239 void RenderWidget::StartCompositor() { |
2238 // For widgets that are never visible, we don't need the compositor to run | 2240 // For widgets that are never visible, we don't need the compositor to run |
2239 // at all. | 2241 // at all. |
2240 if (never_visible_) | 2242 if (never_visible_) |
2241 return; | 2243 return; |
2242 // In tests without a RenderThreadImpl, don't set ready as this kicks | 2244 // In tests without a RenderThreadImpl, don't set ready as this kicks |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2454 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2456 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2455 video_hole_frames_.AddObserver(frame); | 2457 video_hole_frames_.AddObserver(frame); |
2456 } | 2458 } |
2457 | 2459 |
2458 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2460 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2459 video_hole_frames_.RemoveObserver(frame); | 2461 video_hole_frames_.RemoveObserver(frame); |
2460 } | 2462 } |
2461 #endif // defined(VIDEO_HOLE) | 2463 #endif // defined(VIDEO_HOLE) |
2462 | 2464 |
2463 } // namespace content | 2465 } // namespace content |
OLD | NEW |