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/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 Loading... |
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_DidStopFlinging, OnFlingingStopped) |
478 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) | 479 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) |
479 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) | 480 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) |
480 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) | 481 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) |
481 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) | 482 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) |
482 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) | 483 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) |
483 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged, | 484 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged, |
484 OnTextInputTypeChanged) | 485 OnTextInputTypeChanged) |
485 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, | 486 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, |
486 OnImeCancelComposition) | 487 OnImeCancelComposition) |
487 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, | 488 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1527 return true; | 1528 return true; |
1528 } | 1529 } |
1529 | 1530 |
1530 void RenderWidgetHostImpl::OnOverscrolled( | 1531 void RenderWidgetHostImpl::OnOverscrolled( |
1531 gfx::Vector2dF accumulated_overscroll, | 1532 gfx::Vector2dF accumulated_overscroll, |
1532 gfx::Vector2dF current_fling_velocity) { | 1533 gfx::Vector2dF current_fling_velocity) { |
1533 if (view_) | 1534 if (view_) |
1534 view_->OnOverscrolled(accumulated_overscroll, current_fling_velocity); | 1535 view_->OnOverscrolled(accumulated_overscroll, current_fling_velocity); |
1535 } | 1536 } |
1536 | 1537 |
| 1538 void RenderWidgetHostImpl::OnFlingingStopped() { |
| 1539 if (view_) |
| 1540 view_->DidStopFlinging(); |
| 1541 } |
| 1542 |
1537 void RenderWidgetHostImpl::OnUpdateRect( | 1543 void RenderWidgetHostImpl::OnUpdateRect( |
1538 const ViewHostMsg_UpdateRect_Params& params) { | 1544 const ViewHostMsg_UpdateRect_Params& params) { |
1539 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); | 1545 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); |
1540 TimeTicks paint_start = TimeTicks::Now(); | 1546 TimeTicks paint_start = TimeTicks::Now(); |
1541 | 1547 |
1542 // Update our knowledge of the RenderWidget's size. | 1548 // Update our knowledge of the RenderWidget's size. |
1543 current_size_ = params.view_size; | 1549 current_size_ = params.view_size; |
1544 // Update our knowledge of the RenderWidget's scroll offset. | 1550 // Update our knowledge of the RenderWidget's scroll offset. |
1545 last_scroll_offset_ = params.scroll_offset; | 1551 last_scroll_offset_ = params.scroll_offset; |
1546 | 1552 |
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2468 continue; | 2474 continue; |
2469 } | 2475 } |
2470 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); | 2476 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); |
2471 if (rwhi_set.insert(rwhi).second) | 2477 if (rwhi_set.insert(rwhi).second) |
2472 rwhi->FrameSwapped(latency_info); | 2478 rwhi->FrameSwapped(latency_info); |
2473 } | 2479 } |
2474 } | 2480 } |
2475 } | 2481 } |
2476 | 2482 |
2477 } // namespace content | 2483 } // namespace content |
OLD | NEW |