| 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 20 matching lines...) Expand all Loading... |
| 31 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 31 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 32 #include "content/browser/gpu/gpu_surface_tracker.h" | 32 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 33 #include "content/browser/renderer_host/backing_store.h" | 33 #include "content/browser/renderer_host/backing_store.h" |
| 34 #include "content/browser/renderer_host/backing_store_manager.h" | 34 #include "content/browser/renderer_host/backing_store_manager.h" |
| 35 #include "content/browser/renderer_host/dip_util.h" | 35 #include "content/browser/renderer_host/dip_util.h" |
| 36 #include "content/browser/renderer_host/input/input_router_impl.h" | 36 #include "content/browser/renderer_host/input/input_router_impl.h" |
| 37 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 37 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
| 38 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" | 38 #include "content/browser/renderer_host/input/synthetic_gesture_controller.h" |
| 39 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 39 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
| 40 #include "content/browser/renderer_host/input/timeout_monitor.h" | 40 #include "content/browser/renderer_host/input/timeout_monitor.h" |
| 41 #include "content/browser/renderer_host/input/touch_emulator.h" |
| 41 #include "content/browser/renderer_host/overscroll_controller.h" | 42 #include "content/browser/renderer_host/overscroll_controller.h" |
| 42 #include "content/browser/renderer_host/render_process_host_impl.h" | 43 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 43 #include "content/browser/renderer_host/render_view_host_impl.h" | 44 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 44 #include "content/browser/renderer_host/render_widget_helper.h" | 45 #include "content/browser/renderer_host/render_widget_helper.h" |
| 45 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 46 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| 46 #include "content/common/accessibility_messages.h" | 47 #include "content/common/accessibility_messages.h" |
| 47 #include "content/common/content_constants_internal.h" | 48 #include "content/common/content_constants_internal.h" |
| 48 #include "content/common/cursors/webcursor.h" | 49 #include "content/common/cursors/webcursor.h" |
| 49 #include "content/common/gpu/gpu_messages.h" | 50 #include "content/common/gpu/gpu_messages.h" |
| 50 #include "content/common/input_messages.h" | 51 #include "content/common/input_messages.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // If we're initially visible, tell the process host that we're alive. | 237 // If we're initially visible, tell the process host that we're alive. |
| 237 // Otherwise we'll notify the process host when we are first shown. | 238 // Otherwise we'll notify the process host when we are first shown. |
| 238 if (!hidden) | 239 if (!hidden) |
| 239 process_->WidgetRestored(); | 240 process_->WidgetRestored(); |
| 240 | 241 |
| 241 accessibility_mode_ = | 242 accessibility_mode_ = |
| 242 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); | 243 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); |
| 243 | 244 |
| 244 input_router_.reset(new InputRouterImpl(process_, this, this, routing_id_)); | 245 input_router_.reset(new InputRouterImpl(process_, this, this, routing_id_)); |
| 245 | 246 |
| 247 touch_emulator_.reset(); |
| 248 |
| 246 #if defined(USE_AURA) | 249 #if defined(USE_AURA) |
| 247 bool overscroll_enabled = CommandLine::ForCurrentProcess()-> | 250 bool overscroll_enabled = CommandLine::ForCurrentProcess()-> |
| 248 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; | 251 GetSwitchValueASCII(switches::kOverscrollHistoryNavigation) != "0"; |
| 249 SetOverscrollControllerEnabled(overscroll_enabled); | 252 SetOverscrollControllerEnabled(overscroll_enabled); |
| 250 #endif | 253 #endif |
| 251 | 254 |
| 252 if (GetProcess()->IsGuest() || !CommandLine::ForCurrentProcess()->HasSwitch( | 255 if (GetProcess()->IsGuest() || !CommandLine::ForCurrentProcess()->HasSwitch( |
| 253 switches::kDisableHangMonitor)) { | 256 switches::kDisableHangMonitor)) { |
| 254 hang_monitor_timeout_.reset(new TimeoutMonitor( | 257 hang_monitor_timeout_.reset(new TimeoutMonitor( |
| 255 base::Bind(&RenderWidgetHostImpl::RendererIsUnresponsive, | 258 base::Bind(&RenderWidgetHostImpl::RendererIsUnresponsive, |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) | 479 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) |
| 477 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, | 480 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, |
| 478 msg_is_ok = OnSwapCompositorFrame(msg)) | 481 msg_is_ok = OnSwapCompositorFrame(msg)) |
| 479 IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled) | 482 IPC_MESSAGE_HANDLER(ViewHostMsg_DidOverscroll, OnOverscrolled) |
| 480 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopFlinging, OnFlingingStopped) | 483 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopFlinging, OnFlingingStopped) |
| 481 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) | 484 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) |
| 482 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) | 485 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed) |
| 483 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) | 486 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) |
| 484 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) | 487 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) |
| 485 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) | 488 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) |
| 489 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTouchEventEmulationEnabled, |
| 490 OnSetTouchEventEmulationEnabled) |
| 486 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged, | 491 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged, |
| 487 OnTextInputTypeChanged) | 492 OnTextInputTypeChanged) |
| 488 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, | 493 IPC_MESSAGE_HANDLER(ViewHostMsg_ImeCancelComposition, |
| 489 OnImeCancelComposition) | 494 OnImeCancelComposition) |
| 490 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, | 495 IPC_MESSAGE_HANDLER(ViewHostMsg_DidActivateAcceleratedCompositing, |
| 491 OnDidActivateAcceleratedCompositing) | 496 OnDidActivateAcceleratedCompositing) |
| 492 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) | 497 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) |
| 493 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse) | 498 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse) |
| 494 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup, | 499 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup, |
| 495 OnShowDisambiguationPopup) | 500 OnShowDisambiguationPopup) |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 // If there is a pending mouse lock request, we don't want to reject it at | 679 // If there is a pending mouse lock request, we don't want to reject it at |
| 675 // this point. The user can switch focus back to this view and approve the | 680 // this point. The user can switch focus back to this view and approve the |
| 676 // request later. | 681 // request later. |
| 677 if (IsMouseLocked()) | 682 if (IsMouseLocked()) |
| 678 view_->UnlockMouse(); | 683 view_->UnlockMouse(); |
| 679 | 684 |
| 680 // If there is a pending overscroll, then that should be cancelled. | 685 // If there is a pending overscroll, then that should be cancelled. |
| 681 if (overscroll_controller_) | 686 if (overscroll_controller_) |
| 682 overscroll_controller_->Cancel(); | 687 overscroll_controller_->Cancel(); |
| 683 | 688 |
| 689 if (touch_emulator_) |
| 690 touch_emulator_->CancelTouch(); |
| 691 |
| 684 Send(new InputMsg_SetFocus(routing_id_, false)); | 692 Send(new InputMsg_SetFocus(routing_id_, false)); |
| 685 } | 693 } |
| 686 | 694 |
| 687 void RenderWidgetHostImpl::LostCapture() { | 695 void RenderWidgetHostImpl::LostCapture() { |
| 696 if (touch_emulator_) |
| 697 touch_emulator_->CancelTouch(); |
| 698 |
| 688 Send(new InputMsg_MouseCaptureLost(routing_id_)); | 699 Send(new InputMsg_MouseCaptureLost(routing_id_)); |
| 689 } | 700 } |
| 690 | 701 |
| 691 void RenderWidgetHostImpl::SetActive(bool active) { | 702 void RenderWidgetHostImpl::SetActive(bool active) { |
| 692 Send(new ViewMsg_SetActive(routing_id_, active)); | 703 Send(new ViewMsg_SetActive(routing_id_, active)); |
| 693 } | 704 } |
| 694 | 705 |
| 695 void RenderWidgetHostImpl::LostMouseLock() { | 706 void RenderWidgetHostImpl::LostMouseLock() { |
| 696 Send(new ViewMsg_MouseLockLost(routing_id_)); | 707 Send(new ViewMsg_MouseLockLost(routing_id_)); |
| 697 } | 708 } |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 CreateRWHLatencyInfoIfNotExist(&ui_latency, mouse_event.type); | 995 CreateRWHLatencyInfoIfNotExist(&ui_latency, mouse_event.type); |
| 985 | 996 |
| 986 for (size_t i = 0; i < mouse_event_callbacks_.size(); ++i) { | 997 for (size_t i = 0; i < mouse_event_callbacks_.size(); ++i) { |
| 987 if (mouse_event_callbacks_[i].Run(mouse_event)) | 998 if (mouse_event_callbacks_[i].Run(mouse_event)) |
| 988 return; | 999 return; |
| 989 } | 1000 } |
| 990 | 1001 |
| 991 if (IgnoreInputEvents()) | 1002 if (IgnoreInputEvents()) |
| 992 return; | 1003 return; |
| 993 | 1004 |
| 1005 if (touch_emulator_ && touch_emulator_->HandleMouseEvent(mouse_event)) |
| 1006 return; |
| 1007 |
| 994 input_router_->SendMouseEvent(MouseEventWithLatencyInfo(mouse_event, | 1008 input_router_->SendMouseEvent(MouseEventWithLatencyInfo(mouse_event, |
| 995 latency_info)); | 1009 latency_info)); |
| 996 } | 1010 } |
| 997 | 1011 |
| 998 void RenderWidgetHostImpl::OnPointerEventActivate() { | 1012 void RenderWidgetHostImpl::OnPointerEventActivate() { |
| 999 } | 1013 } |
| 1000 | 1014 |
| 1001 void RenderWidgetHostImpl::ForwardWheelEvent( | 1015 void RenderWidgetHostImpl::ForwardWheelEvent( |
| 1002 const WebMouseWheelEvent& wheel_event) { | 1016 const WebMouseWheelEvent& wheel_event) { |
| 1003 ForwardWheelEventWithLatencyInfo(wheel_event, ui::LatencyInfo()); | 1017 ForwardWheelEventWithLatencyInfo(wheel_event, ui::LatencyInfo()); |
| 1004 } | 1018 } |
| 1005 | 1019 |
| 1006 void RenderWidgetHostImpl::ForwardWheelEventWithLatencyInfo( | 1020 void RenderWidgetHostImpl::ForwardWheelEventWithLatencyInfo( |
| 1007 const blink::WebMouseWheelEvent& wheel_event, | 1021 const blink::WebMouseWheelEvent& wheel_event, |
| 1008 const ui::LatencyInfo& ui_latency) { | 1022 const ui::LatencyInfo& ui_latency) { |
| 1009 TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardWheelEvent"); | 1023 TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardWheelEvent"); |
| 1010 | 1024 |
| 1011 ui::LatencyInfo latency_info = | 1025 ui::LatencyInfo latency_info = |
| 1012 CreateRWHLatencyInfoIfNotExist(&ui_latency, wheel_event.type); | 1026 CreateRWHLatencyInfoIfNotExist(&ui_latency, wheel_event.type); |
| 1013 | 1027 |
| 1014 if (IgnoreInputEvents()) | 1028 if (IgnoreInputEvents()) |
| 1015 return; | 1029 return; |
| 1016 | 1030 |
| 1031 if (touch_emulator_ && touch_emulator_->HandleMouseWheelEvent(wheel_event)) |
| 1032 return; |
| 1033 |
| 1017 input_router_->SendWheelEvent(MouseWheelEventWithLatencyInfo(wheel_event, | 1034 input_router_->SendWheelEvent(MouseWheelEventWithLatencyInfo(wheel_event, |
| 1018 latency_info)); | 1035 latency_info)); |
| 1019 } | 1036 } |
| 1020 | 1037 |
| 1021 void RenderWidgetHostImpl::ForwardGestureEvent( | 1038 void RenderWidgetHostImpl::ForwardGestureEvent( |
| 1022 const blink::WebGestureEvent& gesture_event) { | 1039 const blink::WebGestureEvent& gesture_event) { |
| 1023 ForwardGestureEventWithLatencyInfo(gesture_event, ui::LatencyInfo()); | 1040 ForwardGestureEventWithLatencyInfo(gesture_event, ui::LatencyInfo()); |
| 1024 } | 1041 } |
| 1025 | 1042 |
| 1026 void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo( | 1043 void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo( |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 | 1148 |
| 1132 // Tab switching/closing accelerators aren't sent to the renderer to avoid | 1149 // Tab switching/closing accelerators aren't sent to the renderer to avoid |
| 1133 // a hung/malicious renderer from interfering. | 1150 // a hung/malicious renderer from interfering. |
| 1134 if (delegate_->PreHandleKeyboardEvent(key_event, &is_shortcut)) | 1151 if (delegate_->PreHandleKeyboardEvent(key_event, &is_shortcut)) |
| 1135 return; | 1152 return; |
| 1136 | 1153 |
| 1137 if (key_event.type == WebKeyboardEvent::RawKeyDown) | 1154 if (key_event.type == WebKeyboardEvent::RawKeyDown) |
| 1138 suppress_next_char_events_ = false; | 1155 suppress_next_char_events_ = false; |
| 1139 } | 1156 } |
| 1140 | 1157 |
| 1158 if (touch_emulator_ && touch_emulator_->HandleKeyboardEvent(key_event)) |
| 1159 return; |
| 1160 |
| 1141 input_router_->SendKeyboardEvent( | 1161 input_router_->SendKeyboardEvent( |
| 1142 key_event, | 1162 key_event, |
| 1143 CreateRWHLatencyInfoIfNotExist(NULL, key_event.type), | 1163 CreateRWHLatencyInfoIfNotExist(NULL, key_event.type), |
| 1144 is_shortcut); | 1164 is_shortcut); |
| 1145 } | 1165 } |
| 1146 | 1166 |
| 1147 void RenderWidgetHostImpl::QueueSyntheticGesture( | 1167 void RenderWidgetHostImpl::QueueSyntheticGesture( |
| 1148 scoped_ptr<SyntheticGesture> synthetic_gesture, | 1168 scoped_ptr<SyntheticGesture> synthetic_gesture, |
| 1149 const base::Callback<void(SyntheticGesture::Result)>& on_complete) { | 1169 const base::Callback<void(SyntheticGesture::Result)>& on_complete) { |
| 1150 if (!synthetic_gesture_controller_ && view_) { | 1170 if (!synthetic_gesture_controller_ && view_) { |
| 1151 synthetic_gesture_controller_.reset( | 1171 synthetic_gesture_controller_.reset( |
| 1152 new SyntheticGestureController( | 1172 new SyntheticGestureController( |
| 1153 view_->CreateSyntheticGestureTarget().Pass())); | 1173 view_->CreateSyntheticGestureTarget().Pass())); |
| 1154 } | 1174 } |
| 1155 if (synthetic_gesture_controller_) { | 1175 if (synthetic_gesture_controller_) { |
| 1156 synthetic_gesture_controller_->QueueSyntheticGesture( | 1176 synthetic_gesture_controller_->QueueSyntheticGesture( |
| 1157 synthetic_gesture.Pass(), on_complete); | 1177 synthetic_gesture.Pass(), on_complete); |
| 1158 } | 1178 } |
| 1159 } | 1179 } |
| 1160 | 1180 |
| 1181 void RenderWidgetHostImpl::SetCursor(const WebCursor& cursor) { |
| 1182 if (!view_) |
| 1183 return; |
| 1184 view_->UpdateCursor(cursor); |
| 1185 } |
| 1186 |
| 1161 void RenderWidgetHostImpl::SendCursorVisibilityState(bool is_visible) { | 1187 void RenderWidgetHostImpl::SendCursorVisibilityState(bool is_visible) { |
| 1162 Send(new InputMsg_CursorVisibilityChange(GetRoutingID(), is_visible)); | 1188 Send(new InputMsg_CursorVisibilityChange(GetRoutingID(), is_visible)); |
| 1163 } | 1189 } |
| 1164 | 1190 |
| 1165 int64 RenderWidgetHostImpl::GetLatencyComponentId() { | 1191 int64 RenderWidgetHostImpl::GetLatencyComponentId() { |
| 1166 return GetRoutingID() | (static_cast<int64>(GetProcess()->GetID()) << 32); | 1192 return GetRoutingID() | (static_cast<int64>(GetProcess()->GetID()) << 32); |
| 1167 } | 1193 } |
| 1168 | 1194 |
| 1169 // static | 1195 // static |
| 1170 void RenderWidgetHostImpl::DisableResizeAckCheckForTesting() { | 1196 void RenderWidgetHostImpl::DisableResizeAckCheckForTesting() { |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1805 GetProcess()->ReceivedBadMessage(); | 1831 GetProcess()->ReceivedBadMessage(); |
| 1806 } | 1832 } |
| 1807 | 1833 |
| 1808 void RenderWidgetHostImpl::OnBlur() { | 1834 void RenderWidgetHostImpl::OnBlur() { |
| 1809 // Only RenderViewHost can deal with that message. | 1835 // Only RenderViewHost can deal with that message. |
| 1810 RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH5")); | 1836 RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH5")); |
| 1811 GetProcess()->ReceivedBadMessage(); | 1837 GetProcess()->ReceivedBadMessage(); |
| 1812 } | 1838 } |
| 1813 | 1839 |
| 1814 void RenderWidgetHostImpl::OnSetCursor(const WebCursor& cursor) { | 1840 void RenderWidgetHostImpl::OnSetCursor(const WebCursor& cursor) { |
| 1815 if (!view_) { | 1841 SetCursor(cursor); |
| 1816 return; | 1842 } |
| 1843 |
| 1844 void RenderWidgetHostImpl::OnSetTouchEventEmulationEnabled(bool enabled) { |
| 1845 if (enabled) { |
| 1846 if (!touch_emulator_) |
| 1847 touch_emulator_.reset(new TouchEmulator(this)); |
| 1848 } else { |
| 1849 touch_emulator_.reset(); |
| 1817 } | 1850 } |
| 1818 view_->UpdateCursor(cursor); | |
| 1819 } | 1851 } |
| 1820 | 1852 |
| 1821 void RenderWidgetHostImpl::OnTextInputTypeChanged( | 1853 void RenderWidgetHostImpl::OnTextInputTypeChanged( |
| 1822 ui::TextInputType type, | 1854 ui::TextInputType type, |
| 1823 ui::TextInputMode input_mode, | 1855 ui::TextInputMode input_mode, |
| 1824 bool can_compose_inline) { | 1856 bool can_compose_inline) { |
| 1825 if (view_) | 1857 if (view_) |
| 1826 view_->TextInputTypeChanged(type, input_mode, can_compose_inline); | 1858 view_->TextInputTypeChanged(type, input_mode, can_compose_inline); |
| 1827 } | 1859 } |
| 1828 | 1860 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2143 TouchEventWithLatencyInfo touch_event = event; | 2175 TouchEventWithLatencyInfo touch_event = event; |
| 2144 touch_event.latency.AddLatencyNumber( | 2176 touch_event.latency.AddLatencyNumber( |
| 2145 ui::INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT, 0, 0); | 2177 ui::INPUT_EVENT_LATENCY_ACKED_TOUCH_COMPONENT, 0, 0); |
| 2146 // TouchEvent latency ends at ack if it didn't cause any rendering. | 2178 // TouchEvent latency ends at ack if it didn't cause any rendering. |
| 2147 if (!touch_event.latency.FindLatency( | 2179 if (!touch_event.latency.FindLatency( |
| 2148 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) { | 2180 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) { |
| 2149 touch_event.latency.AddLatencyNumber( | 2181 touch_event.latency.AddLatencyNumber( |
| 2150 ui::INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT, 0, 0); | 2182 ui::INPUT_EVENT_LATENCY_TERMINATED_TOUCH_COMPONENT, 0, 0); |
| 2151 } | 2183 } |
| 2152 ComputeTouchLatency(touch_event.latency); | 2184 ComputeTouchLatency(touch_event.latency); |
| 2185 |
| 2186 if (touch_emulator_ && touch_emulator_->HandleTouchEventAck(ack_result)) |
| 2187 return; |
| 2188 |
| 2153 if (view_) | 2189 if (view_) |
| 2154 view_->ProcessAckedTouchEvent(touch_event, ack_result); | 2190 view_->ProcessAckedTouchEvent(touch_event, ack_result); |
| 2155 } | 2191 } |
| 2156 | 2192 |
| 2157 void RenderWidgetHostImpl::OnUnexpectedEventAck(UnexpectedEventAckType type) { | 2193 void RenderWidgetHostImpl::OnUnexpectedEventAck(UnexpectedEventAckType type) { |
| 2158 if (type == BAD_ACK_MESSAGE) { | 2194 if (type == BAD_ACK_MESSAGE) { |
| 2159 RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH2")); | 2195 RecordAction(base::UserMetricsAction("BadMessageTerminate_RWH2")); |
| 2160 process_->ReceivedBadMessage(); | 2196 process_->ReceivedBadMessage(); |
| 2161 } else if (type == UNEXPECTED_EVENT_TYPE) { | 2197 } else if (type == UNEXPECTED_EVENT_TYPE) { |
| 2162 suppress_next_char_events_ = false; | 2198 suppress_next_char_events_ = false; |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2545 } | 2581 } |
| 2546 } | 2582 } |
| 2547 | 2583 |
| 2548 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { | 2584 SkBitmap::Config RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2549 if (view_) | 2585 if (view_) |
| 2550 return view_->PreferredReadbackFormat(); | 2586 return view_->PreferredReadbackFormat(); |
| 2551 return SkBitmap::kARGB_8888_Config; | 2587 return SkBitmap::kARGB_8888_Config; |
| 2552 } | 2588 } |
| 2553 | 2589 |
| 2554 } // namespace content | 2590 } // namespace content |
| OLD | NEW |