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 2213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2224 } else if (event.type == WebInputEvent::GestureLongPress) { | 2224 } else if (event.type == WebInputEvent::GestureLongPress) { |
2225 DCHECK(webwidget_); | 2225 DCHECK(webwidget_); |
2226 if (webwidget_->textInputInfo().value.isEmpty()) | 2226 if (webwidget_->textInputInfo().value.isEmpty()) |
2227 UpdateTextInputState(NO_SHOW_IME, FROM_NON_IME); | 2227 UpdateTextInputState(NO_SHOW_IME, FROM_NON_IME); |
2228 else | 2228 else |
2229 UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_NON_IME); | 2229 UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_NON_IME); |
2230 } | 2230 } |
2231 #endif | 2231 #endif |
2232 } | 2232 } |
2233 | 2233 |
2234 void RenderWidget::didOverScrollOnMainThread( | |
2235 const float& unusedDeltaX, | |
2236 const float& unusedDeltaY, | |
2237 const float& accumaltedRootOverScrollX, | |
2238 const float& accumaltedRootOverScrollY, | |
2239 const float& positionX, | |
2240 const float& positionY, | |
2241 const float& velocityX, | |
2242 const float& velocityY) { | |
2243 gfx::Vector2dF unusedDelta(unusedDeltaX, unusedDeltaY); | |
2244 gfx::Vector2dF accumaltedRootOverScroll(accumaltedRootOverScrollX, | |
2245 accumaltedRootOverScrollY); | |
2246 gfx::Vector2dF flingVelocity(velocityX, velocityY); | |
2247 gfx::PointF eventPoint(positionX, positionY); | |
2248 Send(new ViewHostMsg_DidOverScrollOnMainThread(routing_id(), unusedDelta, | |
jdduke (slow)
2015/04/24 16:57:23
Can't we just resuse the existing InputHostMsg_Did
MuVen
2015/04/27 09:49:15
we can call InputHostMsg_DidOverscroll from Render
jdduke (slow)
2015/04/27 15:00:49
That's probably fine. To be honest the distributio
| |
2249 accumaltedRootOverScroll, | |
2250 flingVelocity, eventPoint)); | |
2251 } | |
2252 | |
2234 void RenderWidget::StartCompositor() { | 2253 void RenderWidget::StartCompositor() { |
2235 // For widgets that are never visible, we don't need the compositor to run | 2254 // For widgets that are never visible, we don't need the compositor to run |
2236 // at all. | 2255 // at all. |
2237 if (never_visible_) | 2256 if (never_visible_) |
2238 return; | 2257 return; |
2239 // In tests without a RenderThreadImpl, don't set ready as this kicks | 2258 // In tests without a RenderThreadImpl, don't set ready as this kicks |
2240 // off creating output surfaces that the test can't create. | 2259 // off creating output surfaces that the test can't create. |
2241 if (!RenderThreadImpl::current()) | 2260 if (!RenderThreadImpl::current()) |
2242 return; | 2261 return; |
2243 compositor_->StartCompositor(); | 2262 compositor_->StartCompositor(); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2440 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2459 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2441 video_hole_frames_.AddObserver(frame); | 2460 video_hole_frames_.AddObserver(frame); |
2442 } | 2461 } |
2443 | 2462 |
2444 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2463 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2445 video_hole_frames_.RemoveObserver(frame); | 2464 video_hole_frames_.RemoveObserver(frame); |
2446 } | 2465 } |
2447 #endif // defined(VIDEO_HOLE) | 2466 #endif // defined(VIDEO_HOLE) |
2448 | 2467 |
2449 } // namespace content | 2468 } // namespace content |
OLD | NEW |