| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, | 305 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, |
| 306 OnMsgTextInputStateChanged) | 306 OnMsgTextInputStateChanged) |
| 307 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCompositionRangeChanged, | 307 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCompositionRangeChanged, |
| 308 OnMsgImeCompositionRangeChanged) | 308 OnMsgImeCompositionRangeChanged) |
| 309 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, | 309 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, |
| 310 OnMsgImeCancelComposition) | 310 OnMsgImeCancelComposition) |
| 311 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, | 311 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, |
| 312 OnMsgDidActivateAcceleratedCompositing) | 312 OnMsgDidActivateAcceleratedCompositing) |
| 313 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnMsgLockMouse) | 313 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnMsgLockMouse) |
| 314 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnMsgUnlockMouse) | 314 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnMsgUnlockMouse) |
| 315 IPC_MESSAGE_HANDLER(ViewHostMsg_SwapCompositorFrame, |
| 316 OnMsgSwapCompositorFrame) |
| 315 #if defined(OS_POSIX) || defined(USE_AURA) | 317 #if defined(OS_POSIX) || defined(USE_AURA) |
| 316 IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect) | 318 IPC_MESSAGE_HANDLER(ViewHostMsg_GetWindowRect, OnMsgGetWindowRect) |
| 317 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnMsgGetRootWindowRect) | 319 IPC_MESSAGE_HANDLER(ViewHostMsg_GetRootWindowRect, OnMsgGetRootWindowRect) |
| 318 #endif | 320 #endif |
| 319 #if defined(OS_MACOSX) | 321 #if defined(OS_MACOSX) |
| 320 IPC_MESSAGE_HANDLER(ViewHostMsg_PluginFocusChanged, | 322 IPC_MESSAGE_HANDLER(ViewHostMsg_PluginFocusChanged, |
| 321 OnMsgPluginFocusChanged) | 323 OnMsgPluginFocusChanged) |
| 322 IPC_MESSAGE_HANDLER(ViewHostMsg_StartPluginIme, | 324 IPC_MESSAGE_HANDLER(ViewHostMsg_StartPluginIme, |
| 323 OnMsgStartPluginIme) | 325 OnMsgStartPluginIme) |
| 324 IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateFakePluginWindowHandle, | 326 IPC_MESSAGE_HANDLER(ViewHostMsg_AllocateFakePluginWindowHandle, |
| (...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1757 GotResponseToLockMouseRequest(true); | 1759 GotResponseToLockMouseRequest(true); |
| 1758 } else { | 1760 } else { |
| 1759 RequestToLockMouse(user_gesture, last_unlocked_by_target); | 1761 RequestToLockMouse(user_gesture, last_unlocked_by_target); |
| 1760 } | 1762 } |
| 1761 } | 1763 } |
| 1762 | 1764 |
| 1763 void RenderWidgetHostImpl::OnMsgUnlockMouse() { | 1765 void RenderWidgetHostImpl::OnMsgUnlockMouse() { |
| 1764 RejectMouseLockOrUnlockIfNecessary(); | 1766 RejectMouseLockOrUnlockIfNecessary(); |
| 1765 } | 1767 } |
| 1766 | 1768 |
| 1769 void RenderWidgetHostImpl::OnMsgSwapCompositorFrame( |
| 1770 const cc::CompositorFrame& frame) { |
| 1771 if (!view_) { |
| 1772 cc::CompositorFrameAck ack; |
| 1773 ack.resources = frame.resources; |
| 1774 SwapCompositorFrameAck(ack); |
| 1775 return; |
| 1776 } |
| 1777 view_->SwapCompositorFrame(frame); |
| 1778 } |
| 1779 |
| 1780 void RenderWidgetHostImpl::SwapCompositorFrameAck( |
| 1781 const cc::CompositorFrameAck& ack) { |
| 1782 Send(new ViewMsg_SwapCompositorFrameACK(routing_id_, ack)); |
| 1783 } |
| 1784 |
| 1767 #if defined(OS_POSIX) || defined(USE_AURA) | 1785 #if defined(OS_POSIX) || defined(USE_AURA) |
| 1768 void RenderWidgetHostImpl::OnMsgGetWindowRect(gfx::NativeViewId window_id, | 1786 void RenderWidgetHostImpl::OnMsgGetWindowRect(gfx::NativeViewId window_id, |
| 1769 gfx::Rect* results) { | 1787 gfx::Rect* results) { |
| 1770 if (view_) | 1788 if (view_) |
| 1771 *results = view_->GetViewBounds(); | 1789 *results = view_->GetViewBounds(); |
| 1772 } | 1790 } |
| 1773 | 1791 |
| 1774 void RenderWidgetHostImpl::OnMsgGetRootWindowRect(gfx::NativeViewId window_id, | 1792 void RenderWidgetHostImpl::OnMsgGetRootWindowRect(gfx::NativeViewId window_id, |
| 1775 gfx::Rect* results) { | 1793 gfx::Rect* results) { |
| 1776 if (view_) | 1794 if (view_) |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2075 return; | 2093 return; |
| 2076 | 2094 |
| 2077 OnRenderAutoResized(new_size); | 2095 OnRenderAutoResized(new_size); |
| 2078 } | 2096 } |
| 2079 | 2097 |
| 2080 void RenderWidgetHostImpl::DetachDelegate() { | 2098 void RenderWidgetHostImpl::DetachDelegate() { |
| 2081 delegate_ = NULL; | 2099 delegate_ = NULL; |
| 2082 } | 2100 } |
| 2083 | 2101 |
| 2084 } // namespace content | 2102 } // namespace content |
| OLD | NEW |