| 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 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2222 } else if (event.type == WebInputEvent::GestureLongPress) { | 2222 } else if (event.type == WebInputEvent::GestureLongPress) { |
| 2223 DCHECK(webwidget_); | 2223 DCHECK(webwidget_); |
| 2224 if (webwidget_->textInputInfo().value.isEmpty()) | 2224 if (webwidget_->textInputInfo().value.isEmpty()) |
| 2225 UpdateTextInputState(NO_SHOW_IME, FROM_NON_IME); | 2225 UpdateTextInputState(NO_SHOW_IME, FROM_NON_IME); |
| 2226 else | 2226 else |
| 2227 UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_NON_IME); | 2227 UpdateTextInputState(SHOW_IME_IF_NEEDED, FROM_NON_IME); |
| 2228 } | 2228 } |
| 2229 #endif | 2229 #endif |
| 2230 } | 2230 } |
| 2231 | 2231 |
| 2232 void RenderWidget::didOverscroll( |
| 2233 const gfx::Vector2dF& unusedDelta, |
| 2234 const gfx::Vector2dF& accumulatedRootOverScroll, |
| 2235 const gfx::PointF& position, |
| 2236 const gfx::Vector2dF& velocity) { |
| 2237 DidOverscrollParams params; |
| 2238 params.accumulated_overscroll = accumulatedRootOverScroll; |
| 2239 params.latest_overscroll_delta = unusedDelta; |
| 2240 params.current_fling_velocity = velocity; |
| 2241 params.causal_event_viewport_point = position; |
| 2242 Send(new InputHostMsg_DidOverscroll(routing_id_, params)); |
| 2243 } |
| 2244 |
| 2232 void RenderWidget::StartCompositor() { | 2245 void RenderWidget::StartCompositor() { |
| 2233 // For widgets that are never visible, we don't need the compositor to run | 2246 // For widgets that are never visible, we don't need the compositor to run |
| 2234 // at all. | 2247 // at all. |
| 2235 if (never_visible_) | 2248 if (never_visible_) |
| 2236 return; | 2249 return; |
| 2237 // In tests without a RenderThreadImpl, don't set ready as this kicks | 2250 // In tests without a RenderThreadImpl, don't set ready as this kicks |
| 2238 // off creating output surfaces that the test can't create. | 2251 // off creating output surfaces that the test can't create. |
| 2239 if (!RenderThreadImpl::current()) | 2252 if (!RenderThreadImpl::current()) |
| 2240 return; | 2253 return; |
| 2241 compositor_->StartCompositor(); | 2254 compositor_->StartCompositor(); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2449 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2462 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2450 video_hole_frames_.AddObserver(frame); | 2463 video_hole_frames_.AddObserver(frame); |
| 2451 } | 2464 } |
| 2452 | 2465 |
| 2453 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2466 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
| 2454 video_hole_frames_.RemoveObserver(frame); | 2467 video_hole_frames_.RemoveObserver(frame); |
| 2455 } | 2468 } |
| 2456 #endif // defined(VIDEO_HOLE) | 2469 #endif // defined(VIDEO_HOLE) |
| 2457 | 2470 |
| 2458 } // namespace content | 2471 } // namespace content |
| OLD | NEW |