Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: content/renderer/render_widget.cc

Issue 1102743002: OverscrollGlow for mainThread-{CHROMIUM CHANGES} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed review comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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;
2231 // TODO(jdduke): Consider bundling the overscroll with the input event ack to
2232 // save an IPC.
2233 params.accumulated_overscroll = gfx::Vector2dF(
2234 accumulatedRootOverScroll.width, accumulatedRootOverScroll.height);
2235 params.latest_overscroll_delta =
2236 gfx::Vector2dF(unusedDelta.width, unusedDelta.height);
2237 params.current_fling_velocity =
2238 gfx::Vector2dF(velocity.width, velocity.height);
2239 params.causal_event_viewport_point = gfx::PointF(position.x, position.y);
2240 Send(new InputHostMsg_DidOverscroll(routing_id_, params));
2241 }
2242
2225 void RenderWidget::StartCompositor() { 2243 void RenderWidget::StartCompositor() {
2226 // For widgets that are never visible, we don't need the compositor to run 2244 // For widgets that are never visible, we don't need the compositor to run
2227 // at all. 2245 // at all.
2228 if (never_visible_) 2246 if (never_visible_)
2229 return; 2247 return;
2230 // In tests without a RenderThreadImpl, don't set ready as this kicks 2248 // In tests without a RenderThreadImpl, don't set ready as this kicks
2231 // off creating output surfaces that the test can't create. 2249 // off creating output surfaces that the test can't create.
2232 if (!RenderThreadImpl::current()) 2250 if (!RenderThreadImpl::current())
2233 return; 2251 return;
2234 compositor_->StartCompositor(); 2252 compositor_->StartCompositor();
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
2442 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { 2460 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) {
2443 video_hole_frames_.AddObserver(frame); 2461 video_hole_frames_.AddObserver(frame);
2444 } 2462 }
2445 2463
2446 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { 2464 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) {
2447 video_hole_frames_.RemoveObserver(frame); 2465 video_hole_frames_.RemoveObserver(frame);
2448 } 2466 }
2449 #endif // defined(VIDEO_HOLE) 2467 #endif // defined(VIDEO_HOLE)
2450 2468
2451 } // namespace content 2469 } // namespace content
OLDNEW
« content/renderer/render_widget.h ('K') | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698