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

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

Issue 23364004: Implementation of device metrics emulation in render view. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixed reviewers comments Created 7 years, 2 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 | Annotate | Revision Log
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 <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped, 470 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped,
471 OnCompositorSurfaceBuffersSwapped) 471 OnCompositorSurfaceBuffersSwapped)
472 #endif 472 #endif
473 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, 473 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame,
474 msg_is_ok = OnSwapCompositorFrame(msg)) 474 msg_is_ok = OnSwapCompositorFrame(msg))
475 IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled) 475 IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled)
476 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) 476 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
477 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) 477 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
478 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnBeginSmoothScroll) 478 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnBeginSmoothScroll)
479 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginPinch, OnBeginPinch) 479 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginPinch, OnBeginPinch)
480 IPC_MESSAGE_HANDLER(ViewHostMsg_SetExpectedSize, OnSetExpectedSize)
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,
488 OnDidActivateAcceleratedCompositing) 489 OnDidActivateAcceleratedCompositing)
489 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) 490 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse)
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 synthetic_gesture_controller_.BeginSmoothScroll(view_, params); 1749 synthetic_gesture_controller_.BeginSmoothScroll(view_, params);
1749 } 1750 }
1750 1751
1751 void RenderWidgetHostImpl::OnBeginPinch( 1752 void RenderWidgetHostImpl::OnBeginPinch(
1752 const ViewHostMsg_BeginPinch_Params& params) { 1753 const ViewHostMsg_BeginPinch_Params& params) {
1753 if (!view_) 1754 if (!view_)
1754 return; 1755 return;
1755 synthetic_gesture_controller_.BeginPinch(view_, params); 1756 synthetic_gesture_controller_.BeginPinch(view_, params);
1756 } 1757 }
1757 1758
1759 void RenderWidgetHostImpl::OnSetExpectedSize(const gfx::Size& size) {
1760 if (view_)
1761 view_->SetExpectedRenderedSize(size);
1762 }
1763
1758 void RenderWidgetHostImpl::OnFocus() { 1764 void RenderWidgetHostImpl::OnFocus() {
1759 // Only RenderViewHost can deal with that message. 1765 // Only RenderViewHost can deal with that message.
1760 RecordAction(UserMetricsAction("BadMessageTerminate_RWH4")); 1766 RecordAction(UserMetricsAction("BadMessageTerminate_RWH4"));
1761 GetProcess()->ReceivedBadMessage(); 1767 GetProcess()->ReceivedBadMessage();
1762 } 1768 }
1763 1769
1764 void RenderWidgetHostImpl::OnBlur() { 1770 void RenderWidgetHostImpl::OnBlur() {
1765 // Only RenderViewHost can deal with that message. 1771 // Only RenderViewHost can deal with that message.
1766 RecordAction(UserMetricsAction("BadMessageTerminate_RWH5")); 1772 RecordAction(UserMetricsAction("BadMessageTerminate_RWH5"));
1767 GetProcess()->ReceivedBadMessage(); 1773 GetProcess()->ReceivedBadMessage();
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
2576 int process_id = (b->first.second >> 32) & 0xffffffff; 2582 int process_id = (b->first.second >> 32) & 0xffffffff;
2577 RenderWidgetHost* rwh = 2583 RenderWidgetHost* rwh =
2578 RenderWidgetHost::FromID(process_id, routing_id); 2584 RenderWidgetHost::FromID(process_id, routing_id);
2579 if (!rwh) 2585 if (!rwh)
2580 continue; 2586 continue;
2581 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); 2587 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info);
2582 } 2588 }
2583 } 2589 }
2584 2590
2585 } // namespace content 2591 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698