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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 131373004: Let the browser know the end of fling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add DidStartFlinging(); Don't bother ContentViewGestureHandler and GestureEventFilter # Created 6 years, 11 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/browser/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) 468 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove)
469 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) 469 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText)
470 IPC_MESSAGE_HANDLER(ViewHostMsg_PaintAtSize_ACK, OnPaintAtSizeAck) 470 IPC_MESSAGE_HANDLER(ViewHostMsg_PaintAtSize_ACK, OnPaintAtSizeAck)
471 #if defined(OS_MACOSX) 471 #if defined(OS_MACOSX)
472 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped, 472 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped,
473 OnCompositorSurfaceBuffersSwapped) 473 OnCompositorSurfaceBuffersSwapped)
474 #endif 474 #endif
475 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, 475 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame,
476 msg_is_ok = OnSwapCompositorFrame(msg)) 476 msg_is_ok = OnSwapCompositorFrame(msg))
477 IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled) 477 IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled)
478 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartFlinging, OnFlingingStarted)
479 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopFlinging, OnFlingingStopped)
478 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) 480 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
479 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) 481 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
480 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) 482 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus)
481 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) 483 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur)
482 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) 484 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
483 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged, 485 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged,
484 OnTextInputTypeChanged) 486 OnTextInputTypeChanged)
485 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, 487 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition,
486 OnImeCancelComposition) 488 OnImeCancelComposition)
487 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, 489 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing,
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 return true; 1529 return true;
1528 } 1530 }
1529 1531
1530 void RenderWidgetHostImpl::OnOverscrolled( 1532 void RenderWidgetHostImpl::OnOverscrolled(
1531 gfx::Vector2dF accumulated_overscroll, 1533 gfx::Vector2dF accumulated_overscroll,
1532 gfx::Vector2dF current_fling_velocity) { 1534 gfx::Vector2dF current_fling_velocity) {
1533 if (view_) 1535 if (view_)
1534 view_->OnOverscrolled(accumulated_overscroll, current_fling_velocity); 1536 view_->OnOverscrolled(accumulated_overscroll, current_fling_velocity);
1535 } 1537 }
1536 1538
1539 void RenderWidgetHostImpl::OnFlingingStarted() {
1540 if (view_)
1541 view_->DidStartFlinging();
1542 }
1543
1544 void RenderWidgetHostImpl::OnFlingingStopped() {
1545 if (view_)
1546 view_->DidStopFlinging();
1547 }
1548
1537 void RenderWidgetHostImpl::OnUpdateRect( 1549 void RenderWidgetHostImpl::OnUpdateRect(
1538 const ViewHostMsg_UpdateRect_Params& params) { 1550 const ViewHostMsg_UpdateRect_Params& params) {
1539 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); 1551 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect");
1540 TimeTicks paint_start = TimeTicks::Now(); 1552 TimeTicks paint_start = TimeTicks::Now();
1541 1553
1542 // Update our knowledge of the RenderWidget's size. 1554 // Update our knowledge of the RenderWidget's size.
1543 current_size_ = params.view_size; 1555 current_size_ = params.view_size;
1544 // Update our knowledge of the RenderWidget's scroll offset. 1556 // Update our knowledge of the RenderWidget's scroll offset.
1545 last_scroll_offset_ = params.scroll_offset; 1557 last_scroll_offset_ = params.scroll_offset;
1546 1558
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 continue; 2480 continue;
2469 } 2481 }
2470 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); 2482 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh);
2471 if (rwhi_set.insert(rwhi).second) 2483 if (rwhi_set.insert(rwhi).second)
2472 rwhi->FrameSwapped(latency_info); 2484 rwhi->FrameSwapped(latency_info);
2473 } 2485 }
2474 } 2486 }
2475 } 2487 }
2476 2488
2477 } // namespace content 2489 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698