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 2204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2215 } else if (event.type == WebInputEvent::GestureLongPress) { | 2215 } else if (event.type == WebInputEvent::GestureLongPress) { |
2216 DCHECK(webwidget_); | 2216 DCHECK(webwidget_); |
2217 if (webwidget_->textInputInfo().value.isEmpty()) | 2217 if (webwidget_->textInputInfo().value.isEmpty()) |
2218 UpdateTextInputState(NO_SHOW_IME, FROM_NON_IME); | 2218 UpdateTextInputState(NO_SHOW_IME, FROM_NON_IME); |
2219 else | 2219 else |
2220 UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_NON_IME); | 2220 UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_NON_IME); |
2221 } | 2221 } |
2222 #endif | 2222 #endif |
2223 } | 2223 } |
2224 | 2224 |
2225 void RenderWidget::didOverscroll( | |
2226 const blink::WebFloatSize& unusedDelta, | |
2227 const blink::WebFloatSize& accumulatedRootOverScroll, | |
2228 const blink::WebFloatPoint& position, | |
2229 const blink::WebFloatSize& velocity) { | |
2230 DidOverscrollParams params; | |
jdduke (slow)
2015/06/05 14:32:51
Can you add a
"TODO(jdduke): Consider bundling th
MuVen
2015/06/08 07:09:58
Done.
| |
2231 params.accumulated_overscroll = gfx::Vector2dF( | |
2232 accumulatedRootOverScroll.width, accumulatedRootOverScroll.height); | |
2233 params.latest_overscroll_delta = | |
2234 gfx::Vector2dF(unusedDelta.width, unusedDelta.height); | |
2235 params.current_fling_velocity = | |
2236 gfx::Vector2dF(velocity.width, velocity.height); | |
2237 params.causal_event_viewport_point = gfx::PointF(position.x, position.y); | |
2238 Send(new InputHostMsg_DidOverscroll(routing_id_, params)); | |
2239 } | |
2240 | |
2225 void RenderWidget::StartCompositor() { | 2241 void RenderWidget::StartCompositor() { |
2226 // For widgets that are never visible, we don't need the compositor to run | 2242 // For widgets that are never visible, we don't need the compositor to run |
2227 // at all. | 2243 // at all. |
2228 if (never_visible_) | 2244 if (never_visible_) |
2229 return; | 2245 return; |
2230 // In tests without a RenderThreadImpl, don't set ready as this kicks | 2246 // In tests without a RenderThreadImpl, don't set ready as this kicks |
2231 // off creating output surfaces that the test can't create. | 2247 // off creating output surfaces that the test can't create. |
2232 if (!RenderThreadImpl::current()) | 2248 if (!RenderThreadImpl::current()) |
2233 return; | 2249 return; |
2234 compositor_->StartCompositor(); | 2250 compositor_->StartCompositor(); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2442 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2458 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2443 video_hole_frames_.AddObserver(frame); | 2459 video_hole_frames_.AddObserver(frame); |
2444 } | 2460 } |
2445 | 2461 |
2446 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2462 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2447 video_hole_frames_.RemoveObserver(frame); | 2463 video_hole_frames_.RemoveObserver(frame); |
2448 } | 2464 } |
2449 #endif // defined(VIDEO_HOLE) | 2465 #endif // defined(VIDEO_HOLE) |
2450 | 2466 |
2451 } // namespace content | 2467 } // namespace content |
OLD | NEW |