| 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 <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnRenderViewGone) | 342 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnRenderViewGone) |
| 343 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) | 343 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) |
| 344 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, | 344 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, |
| 345 OnUpdateScreenRectsAck) | 345 OnUpdateScreenRectsAck) |
| 346 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) | 346 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) |
| 347 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) | 347 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) |
| 348 IPC_MESSAGE_HANDLER(ViewHostMsg_PaintAtSize_ACK, OnPaintAtSizeAck) | 348 IPC_MESSAGE_HANDLER(ViewHostMsg_PaintAtSize_ACK, OnPaintAtSizeAck) |
| 349 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped, | 349 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped, |
| 350 OnCompositorSurfaceBuffersSwapped) | 350 OnCompositorSurfaceBuffersSwapped) |
| 351 IPC_MESSAGE_HANDLER(ViewHostMsg_SwapCompositorFrame, OnSwapCompositorFrame) | 351 IPC_MESSAGE_HANDLER(ViewHostMsg_SwapCompositorFrame, OnSwapCompositorFrame) |
| 352 IPC_MESSAGE_HANDLER(ViewHostMsg_EnableVSyncNotification, |
| 353 OnEnableVSyncNotification) |
| 352 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) | 354 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) |
| 353 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) | 355 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) |
| 354 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnInputEventAck) | 356 IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnInputEventAck) |
| 355 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnBeginSmoothScroll) | 357 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnBeginSmoothScroll) |
| 356 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectRange_ACK, OnSelectRangeAck) | 358 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectRange_ACK, OnSelectRangeAck) |
| 357 IPC_MESSAGE_HANDLER(ViewHostMsg_MoveCaret_ACK, OnMsgMoveCaretAck) | 359 IPC_MESSAGE_HANDLER(ViewHostMsg_MoveCaret_ACK, OnMsgMoveCaretAck) |
| 358 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) | 360 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) |
| 359 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) | 361 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) |
| 360 IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers, | 362 IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers, |
| 361 OnHasTouchEventHandlers) | 363 OnHasTouchEventHandlers) |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 WebKit::WebScreenInfo screen_info; | 1217 WebKit::WebScreenInfo screen_info; |
| 1216 GetWebScreenInfo(&screen_info); | 1218 GetWebScreenInfo(&screen_info); |
| 1217 Send(new ViewMsg_ScreenInfoChanged(GetRoutingID(), screen_info)); | 1219 Send(new ViewMsg_ScreenInfoChanged(GetRoutingID(), screen_info)); |
| 1218 } | 1220 } |
| 1219 | 1221 |
| 1220 void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase, | 1222 void RenderWidgetHostImpl::UpdateVSyncParameters(base::TimeTicks timebase, |
| 1221 base::TimeDelta interval) { | 1223 base::TimeDelta interval) { |
| 1222 Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval)); | 1224 Send(new ViewMsg_UpdateVSyncParameters(GetRoutingID(), timebase, interval)); |
| 1223 } | 1225 } |
| 1224 | 1226 |
| 1227 void RenderWidgetHostImpl::SendVSync(base::TimeTicks frame_time) { |
| 1228 Send(new ViewMsg_DidVSync(GetRoutingID(), frame_time)); |
| 1229 } |
| 1230 |
| 1225 void RenderWidgetHostImpl::RendererExited(base::TerminationStatus status, | 1231 void RenderWidgetHostImpl::RendererExited(base::TerminationStatus status, |
| 1226 int exit_code) { | 1232 int exit_code) { |
| 1227 // Clearing this flag causes us to re-create the renderer when recovering | 1233 // Clearing this flag causes us to re-create the renderer when recovering |
| 1228 // from a crashed renderer. | 1234 // from a crashed renderer. |
| 1229 renderer_initialized_ = false; | 1235 renderer_initialized_ = false; |
| 1230 | 1236 |
| 1231 waiting_for_screen_rects_ack_ = false; | 1237 waiting_for_screen_rects_ack_ = false; |
| 1232 | 1238 |
| 1233 // Must reset these to ensure that mouse move/wheel events work with a new | 1239 // Must reset these to ensure that mouse move/wheel events work with a new |
| 1234 // renderer. | 1240 // renderer. |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1544 frame.metadata.page_scale_factor, | 1550 frame.metadata.page_scale_factor, |
| 1545 frame.metadata.min_page_scale_factor, | 1551 frame.metadata.min_page_scale_factor, |
| 1546 frame.metadata.max_page_scale_factor, | 1552 frame.metadata.max_page_scale_factor, |
| 1547 gfx::ToCeiledSize(frame.metadata.root_layer_size), | 1553 gfx::ToCeiledSize(frame.metadata.root_layer_size), |
| 1548 frame.metadata.location_bar_offset, | 1554 frame.metadata.location_bar_offset, |
| 1549 frame.metadata.location_bar_content_translation); | 1555 frame.metadata.location_bar_content_translation); |
| 1550 } | 1556 } |
| 1551 #endif | 1557 #endif |
| 1552 } | 1558 } |
| 1553 | 1559 |
| 1560 void RenderWidgetHostImpl::OnEnableVSyncNotification(bool enable) { |
| 1561 TRACE_EVENT1("renderer_host", |
| 1562 "RenderWidgetHostImpl::OnEnableVSyncNotification", "enable", enable); |
| 1563 view_->EnableVSyncNotification(enable); |
| 1564 } |
| 1565 |
| 1554 void RenderWidgetHostImpl::OnUpdateRect( | 1566 void RenderWidgetHostImpl::OnUpdateRect( |
| 1555 const ViewHostMsg_UpdateRect_Params& params) { | 1567 const ViewHostMsg_UpdateRect_Params& params) { |
| 1556 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); | 1568 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); |
| 1557 TimeTicks paint_start = TimeTicks::Now(); | 1569 TimeTicks paint_start = TimeTicks::Now(); |
| 1558 | 1570 |
| 1559 // Update our knowledge of the RenderWidget's size. | 1571 // Update our knowledge of the RenderWidget's size. |
| 1560 current_size_ = params.view_size; | 1572 current_size_ = params.view_size; |
| 1561 // Update our knowledge of the RenderWidget's scroll offset. | 1573 // Update our knowledge of the RenderWidget's scroll offset. |
| 1562 last_scroll_offset_ = params.scroll_offset; | 1574 last_scroll_offset_ = params.scroll_offset; |
| 1563 | 1575 |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2391 return; | 2403 return; |
| 2392 | 2404 |
| 2393 OnRenderAutoResized(new_size); | 2405 OnRenderAutoResized(new_size); |
| 2394 } | 2406 } |
| 2395 | 2407 |
| 2396 void RenderWidgetHostImpl::DetachDelegate() { | 2408 void RenderWidgetHostImpl::DetachDelegate() { |
| 2397 delegate_ = NULL; | 2409 delegate_ = NULL; |
| 2398 } | 2410 } |
| 2399 | 2411 |
| 2400 } // namespace content | 2412 } // namespace content |
| OLD | NEW |