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

Unified Diff: content/renderer/render_widget.cc

Issue 11858007: Splits SmoothGestureController from RenderWidgetHostImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adds missing ifdef for aura Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_widget.h ('k') | tools/telemetry/telemetry/page/actions/scroll.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index b12d3cf4fb7567eaea917900fff01de360252719..69c0f840ec46f097d8cf2dc1645dabf75f8b148c 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -171,7 +171,6 @@ RenderWidget::RenderWidget(WebKit::WebPopupType popup_type,
screen_info_(screen_info),
device_scale_factor_(screen_info_.deviceScaleFactor),
throttle_input_events_(true),
- next_smooth_scroll_gesture_id_(0),
is_threaded_compositing_enabled_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
if (!swapped_out)
@@ -1890,12 +1889,8 @@ void RenderWidget::OnRepaint(const gfx::Size& size_to_paint) {
}
}
-void RenderWidget::OnSmoothScrollCompleted(int gesture_id) {
- PendingSmoothScrollGestureMap::iterator it =
- pending_smooth_scroll_gestures_.find(gesture_id);
- DCHECK(it != pending_smooth_scroll_gestures_.end());
- it->second.Run();
- pending_smooth_scroll_gestures_.erase(it);
+void RenderWidget::OnSmoothScrollCompleted() {
+ pending_smooth_scroll_gesture_.Run();
}
void RenderWidget::OnSetTextDirection(WebTextDirection direction) {
@@ -2265,14 +2260,13 @@ bool RenderWidget::GetGpuRenderingStats(GpuRenderingStats* stats) const {
return gpu_channel->CollectRenderingStatsForSurface(surface_id(), stats);
}
-void RenderWidget::BeginSmoothScroll(
+bool RenderWidget::BeginSmoothScroll(
bool down,
const SmoothScrollCompletionCallback& callback,
int pixels_to_scroll,
int mouse_event_x,
int mouse_event_y) {
DCHECK(!callback.is_null());
- int id = next_smooth_scroll_gesture_id_++;
ViewHostMsg_BeginSmoothScroll_Params params;
params.scroll_down = down;
@@ -2280,8 +2274,10 @@ void RenderWidget::BeginSmoothScroll(
params.mouse_event_x = mouse_event_x;
params.mouse_event_y = mouse_event_y;
- Send(new ViewHostMsg_BeginSmoothScroll(routing_id_, id, params));
- pending_smooth_scroll_gestures_.insert(std::make_pair(id, callback));
+ bool ret = false;
+ Send(new ViewHostMsg_BeginSmoothScroll(routing_id_, params, &ret));
+ pending_smooth_scroll_gesture_ = callback;
+ return ret;
}
bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) {
« no previous file with comments | « content/renderer/render_widget.h ('k') | tools/telemetry/telemetry/page/actions/scroll.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698