Chromium Code Reviews| 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 <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 OnUpdateScreenRectsAck) | 442 OnUpdateScreenRectsAck) |
| 443 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) | 443 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) |
| 444 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) | 444 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) |
| 445 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, | 445 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, |
| 446 OnSwapCompositorFrame(msg)) | 446 OnSwapCompositorFrame(msg)) |
| 447 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopFlinging, OnFlingingStopped) | 447 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopFlinging, OnFlingingStopped) |
| 448 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) | 448 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) |
| 449 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) | 449 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) |
| 450 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) | 450 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) |
| 451 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) | 451 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) |
| 452 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTouchEventEmulationEnabled, | |
| 453 OnSetTouchEventEmulationEnabled) | |
| 454 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, | 452 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputStateChanged, |
| 455 OnTextInputStateChanged) | 453 OnTextInputStateChanged) |
| 456 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) | 454 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) |
| 457 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse) | 455 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse) |
| 458 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup, | 456 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup, |
| 459 OnShowDisambiguationPopup) | 457 OnShowDisambiguationPopup) |
| 460 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnSelectionChanged) | 458 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionChanged, OnSelectionChanged) |
| 461 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, | 459 IPC_MESSAGE_HANDLER(ViewHostMsg_SelectionBoundsChanged, |
| 462 OnSelectionBoundsChanged) | 460 OnSelectionBoundsChanged) |
| 463 #if defined(OS_WIN) | 461 #if defined(OS_WIN) |
| (...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1596 void RenderWidgetHostImpl::OnBlur() { | 1594 void RenderWidgetHostImpl::OnBlur() { |
| 1597 // Only RenderViewHost can deal with that message. | 1595 // Only RenderViewHost can deal with that message. |
| 1598 RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH5")); | 1596 RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH5")); |
| 1599 GetProcess()->ReceivedBadMessage(); | 1597 GetProcess()->ReceivedBadMessage(); |
| 1600 } | 1598 } |
| 1601 | 1599 |
| 1602 void RenderWidgetHostImpl::OnSetCursor(const WebCursor& cursor) { | 1600 void RenderWidgetHostImpl::OnSetCursor(const WebCursor& cursor) { |
| 1603 SetCursor(cursor); | 1601 SetCursor(cursor); |
| 1604 } | 1602 } |
| 1605 | 1603 |
| 1606 void RenderWidgetHostImpl::OnSetTouchEventEmulationEnabled( | |
| 1607 bool enabled, bool allow_pinch) { | |
| 1608 SetTouchEventEmulationEnabled(enabled, allow_pinch); | |
| 1609 } | |
| 1610 | |
| 1611 void RenderWidgetHostImpl::SetTouchEventEmulationEnabled( | 1604 void RenderWidgetHostImpl::SetTouchEventEmulationEnabled( |
| 1612 bool enabled, bool allow_pinch) { | 1605 bool enabled) { |
|
dgozman
2014/08/17 12:39:20
nit: this should fit previous line
pfeldman
2014/08/17 14:47:14
Done.
| |
| 1613 if (delegate_) | |
| 1614 delegate_->OnTouchEmulationEnabled(enabled); | |
| 1615 | |
| 1616 if (enabled) { | 1606 if (enabled) { |
| 1617 if (!touch_emulator_) | 1607 if (!touch_emulator_) |
| 1618 touch_emulator_.reset(new TouchEmulator(this)); | 1608 touch_emulator_.reset(new TouchEmulator(this)); |
| 1619 touch_emulator_->Enable(allow_pinch); | 1609 touch_emulator_->Enable(); |
| 1620 } else { | 1610 } else { |
| 1621 if (touch_emulator_) | 1611 if (touch_emulator_) |
| 1622 touch_emulator_->Disable(); | 1612 touch_emulator_->Disable(); |
| 1623 } | 1613 } |
| 1624 } | 1614 } |
| 1625 | 1615 |
| 1626 void RenderWidgetHostImpl::OnTextInputStateChanged( | 1616 void RenderWidgetHostImpl::OnTextInputStateChanged( |
| 1627 const ViewHostMsg_TextInputState_Params& params) { | 1617 const ViewHostMsg_TextInputState_Params& params) { |
| 1628 if (view_) | 1618 if (view_) |
| 1629 view_->TextInputStateChanged(params); | 1619 view_->TextInputStateChanged(params); |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2329 } | 2319 } |
| 2330 #endif | 2320 #endif |
| 2331 | 2321 |
| 2332 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2322 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2333 if (view_) | 2323 if (view_) |
| 2334 return view_->PreferredReadbackFormat(); | 2324 return view_->PreferredReadbackFormat(); |
| 2335 return kN32_SkColorType; | 2325 return kN32_SkColorType; |
| 2336 } | 2326 } |
| 2337 | 2327 |
| 2338 } // namespace content | 2328 } // namespace content |
| OLD | NEW |