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

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: Created 7 years, 3 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 #if defined(OS_MACOSX) 423 #if defined(OS_MACOSX)
424 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped, 424 IPC_MESSAGE_HANDLER(ViewHostMsg_CompositorSurfaceBuffersSwapped,
425 OnCompositorSurfaceBuffersSwapped) 425 OnCompositorSurfaceBuffersSwapped)
426 #endif 426 #endif
427 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, 427 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame,
428 msg_is_ok = OnSwapCompositorFrame(msg)) 428 msg_is_ok = OnSwapCompositorFrame(msg))
429 IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled) 429 IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled)
430 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) 430 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
431 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) 431 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
432 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnBeginSmoothScroll) 432 IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnBeginSmoothScroll)
433 IPC_MESSAGE_HANDLER(ViewHostMsg_EmulateDevice, OnEmulateDevice)
433 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) 434 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus)
434 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) 435 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur)
435 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) 436 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
436 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged, 437 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged,
437 OnTextInputTypeChanged) 438 OnTextInputTypeChanged)
438 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, 439 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition,
439 OnImeCancelComposition) 440 OnImeCancelComposition)
440 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, 441 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing,
441 OnDidActivateAcceleratedCompositing) 442 OnDidActivateAcceleratedCompositing)
442 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) 443 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse)
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1661 UMA_HISTOGRAM_TIMES("MPArch.RWH_TotalPaintTime", delta); 1662 UMA_HISTOGRAM_TIMES("MPArch.RWH_TotalPaintTime", delta);
1662 } 1663 }
1663 1664
1664 void RenderWidgetHostImpl::OnBeginSmoothScroll( 1665 void RenderWidgetHostImpl::OnBeginSmoothScroll(
1665 const ViewHostMsg_BeginSmoothScroll_Params& params) { 1666 const ViewHostMsg_BeginSmoothScroll_Params& params) {
1666 if (!view_) 1667 if (!view_)
1667 return; 1668 return;
1668 smooth_scroll_gesture_controller_.BeginSmoothScroll(view_, params); 1669 smooth_scroll_gesture_controller_.BeginSmoothScroll(view_, params);
1669 } 1670 }
1670 1671
1672 void RenderWidgetHostImpl::OnEmulateDevice(bool enabled) {
1673 if (view_)
1674 view_->EmulateDevice(enabled);
1675 Send(new ViewMsg_EmulateDevice_ACK(routing_id_, enabled));
1676 }
1677
1671 void RenderWidgetHostImpl::OnFocus() { 1678 void RenderWidgetHostImpl::OnFocus() {
1672 // Only RenderViewHost can deal with that message. 1679 // Only RenderViewHost can deal with that message.
1673 RecordAction(UserMetricsAction("BadMessageTerminate_RWH4")); 1680 RecordAction(UserMetricsAction("BadMessageTerminate_RWH4"));
1674 GetProcess()->ReceivedBadMessage(); 1681 GetProcess()->ReceivedBadMessage();
1675 } 1682 }
1676 1683
1677 void RenderWidgetHostImpl::OnBlur() { 1684 void RenderWidgetHostImpl::OnBlur() {
1678 // Only RenderViewHost can deal with that message. 1685 // Only RenderViewHost can deal with that message.
1679 RecordAction(UserMetricsAction("BadMessageTerminate_RWH5")); 1686 RecordAction(UserMetricsAction("BadMessageTerminate_RWH5"));
1680 GetProcess()->ReceivedBadMessage(); 1687 GetProcess()->ReceivedBadMessage();
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 int process_id = (b->first.second >> 32) & 0xffffffff; 2483 int process_id = (b->first.second >> 32) & 0xffffffff;
2477 RenderWidgetHost* rwh = 2484 RenderWidgetHost* rwh =
2478 RenderWidgetHost::FromID(process_id, routing_id); 2485 RenderWidgetHost::FromID(process_id, routing_id);
2479 if (!rwh) 2486 if (!rwh)
2480 continue; 2487 continue;
2481 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info); 2488 RenderWidgetHostImpl::From(rwh)->FrameSwapped(latency_info);
2482 } 2489 }
2483 } 2490 }
2484 2491
2485 } // namespace content 2492 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698