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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 #if defined(OS_MACOSX) | 427 #if defined(OS_MACOSX) |
428 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped, | 428 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped, |
429 OnCompositorSurfaceBuffersSwapped) | 429 OnCompositorSurfaceBuffersSwapped) |
430 #endif | 430 #endif |
431 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, | 431 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, |
432 msg_is_ok = OnSwapCompositorFrame(msg)) | 432 msg_is_ok = OnSwapCompositorFrame(msg)) |
433 IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled) | 433 IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled) |
434 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) | 434 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) |
435 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) | 435 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) |
436 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnBeginSmoothScroll) | 436 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnBeginSmoothScroll) |
| 437 IPC_MESSAGE_HANDLER(ViewHostMsg_SetExpectedSize, OnSetExpectedSize) |
437 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) | 438 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) |
438 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) | 439 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) |
439 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) | 440 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) |
440 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged, | 441 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged, |
441 OnTextInputTypeChanged) | 442 OnTextInputTypeChanged) |
442 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, | 443 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, |
443 OnImeCancelComposition) | 444 OnImeCancelComposition) |
444 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, | 445 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, |
445 OnDidActivateAcceleratedCompositing) | 446 OnDidActivateAcceleratedCompositing) |
446 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) | 447 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) |
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 UMA_HISTOGRAM_TIMES("MPArch.RWH_TotalPaintTime", delta); | 1698 UMA_HISTOGRAM_TIMES("MPArch.RWH_TotalPaintTime", delta); |
1698 } | 1699 } |
1699 | 1700 |
1700 void RenderWidgetHostImpl::OnBeginSmoothScroll( | 1701 void RenderWidgetHostImpl::OnBeginSmoothScroll( |
1701 const ViewHostMsg_BeginSmoothScroll_Params& params) { | 1702 const ViewHostMsg_BeginSmoothScroll_Params& params) { |
1702 if (!view_) | 1703 if (!view_) |
1703 return; | 1704 return; |
1704 synthetic_gesture_controller_.BeginSmoothScroll(view_, params); | 1705 synthetic_gesture_controller_.BeginSmoothScroll(view_, params); |
1705 } | 1706 } |
1706 | 1707 |
| 1708 void RenderWidgetHostImpl::OnSetExpectedSize(const gfx::Size& size) { |
| 1709 if (view_) |
| 1710 view_->SetExpectedRenderedSize(size); |
| 1711 } |
| 1712 |
1707 void RenderWidgetHostImpl::OnFocus() { | 1713 void RenderWidgetHostImpl::OnFocus() { |
1708 // Only RenderViewHost can deal with that message. | 1714 // Only RenderViewHost can deal with that message. |
1709 RecordAction(UserMetricsAction("BadMessageTerminate_RWH4")); | 1715 RecordAction(UserMetricsAction("BadMessageTerminate_RWH4")); |
1710 GetProcess()->ReceivedBadMessage(); | 1716 GetProcess()->ReceivedBadMessage(); |
1711 } | 1717 } |
1712 | 1718 |
1713 void RenderWidgetHostImpl::OnBlur() { | 1719 void RenderWidgetHostImpl::OnBlur() { |
1714 // Only RenderViewHost can deal with that message. | 1720 // Only RenderViewHost can deal with that message. |
1715 RecordAction(UserMetricsAction("BadMessageTerminate_RWH5")); | 1721 RecordAction(UserMetricsAction("BadMessageTerminate_RWH5")); |
1716 GetProcess()->ReceivedBadMessage(); | 1722 GetProcess()->ReceivedBadMessage(); |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2510 int process_id = (b->first.second >> 32) & 0xffffffff; | 2516 int process_id = (b->first.second >> 32) & 0xffffffff; |
2511 RenderWidgetHost* rwh = | 2517 RenderWidgetHost* rwh = |
2512 RenderWidgetHost::FromID(process_id, routing_id); | 2518 RenderWidgetHost::FromID(process_id, routing_id); |
2513 if (!rwh) | 2519 if (!rwh) |
2514 continue; | 2520 continue; |
2515 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); | 2521 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); |
2516 } | 2522 } |
2517 } | 2523 } |
2518 | 2524 |
2519 } // namespace content | 2525 } // namespace content |
OLD | NEW |