| 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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/debug/trace_event_synthetic_delay.h" | 10 #include "base/debug/trace_event_synthetic_delay.h" |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 INPUT_EVENT_ACK_STATE_CONSUMED : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 1133 INPUT_EVENT_ACK_STATE_CONSUMED : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| 1134 if (!processed && input_event->type == WebInputEvent::TouchStart) { | 1134 if (!processed && input_event->type == WebInputEvent::TouchStart) { |
| 1135 const WebTouchEvent& touch_event = | 1135 const WebTouchEvent& touch_event = |
| 1136 *static_cast<const WebTouchEvent*>(input_event); | 1136 *static_cast<const WebTouchEvent*>(input_event); |
| 1137 // Hit-test for all the pressed touch points. If there is a touch-handler | 1137 // Hit-test for all the pressed touch points. If there is a touch-handler |
| 1138 // for any of the touch points, then the renderer should continue to receive | 1138 // for any of the touch points, then the renderer should continue to receive |
| 1139 // touch events. | 1139 // touch events. |
| 1140 ack_result = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 1140 ack_result = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
| 1141 for (size_t i = 0; i < touch_event.touchesLength; ++i) { | 1141 for (size_t i = 0; i < touch_event.touchesLength; ++i) { |
| 1142 if (touch_event.touches[i].state == WebTouchPoint::StatePressed && | 1142 if (touch_event.touches[i].state == WebTouchPoint::StatePressed && |
| 1143 HasTouchEventHandlersAt(touch_event.touches[i].position)) { | 1143 HasTouchEventHandlersAt( |
| 1144 blink::WebPoint(touch_event.touches[i].position.x, |
| 1145 touch_event.touches[i].position.y))) { |
| 1144 ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 1146 ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| 1145 break; | 1147 break; |
| 1146 } | 1148 } |
| 1147 } | 1149 } |
| 1148 } | 1150 } |
| 1149 | 1151 |
| 1150 bool event_type_can_be_rate_limited = | 1152 bool event_type_can_be_rate_limited = |
| 1151 input_event->type == WebInputEvent::MouseMove || | 1153 input_event->type == WebInputEvent::MouseMove || |
| 1152 input_event->type == WebInputEvent::MouseWheel || | 1154 input_event->type == WebInputEvent::MouseWheel || |
| 1153 input_event->type == WebInputEvent::TouchMove; | 1155 input_event->type == WebInputEvent::TouchMove; |
| (...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2897 | 2899 |
| 2898 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2900 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
| 2899 swapped_out_frames_.AddObserver(frame); | 2901 swapped_out_frames_.AddObserver(frame); |
| 2900 } | 2902 } |
| 2901 | 2903 |
| 2902 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2904 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
| 2903 swapped_out_frames_.RemoveObserver(frame); | 2905 swapped_out_frames_.RemoveObserver(frame); |
| 2904 } | 2906 } |
| 2905 | 2907 |
| 2906 } // namespace content | 2908 } // namespace content |
| OLD | NEW |