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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 54 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
55 #include "third_party/WebKit/public/platform/WebSize.h" | 55 #include "third_party/WebKit/public/platform/WebSize.h" |
56 #include "third_party/WebKit/public/platform/WebString.h" | 56 #include "third_party/WebKit/public/platform/WebString.h" |
57 #include "third_party/WebKit/public/web/WebPagePopup.h" | 57 #include "third_party/WebKit/public/web/WebPagePopup.h" |
58 #include "third_party/WebKit/public/web/WebPopupMenu.h" | 58 #include "third_party/WebKit/public/web/WebPopupMenu.h" |
59 #include "third_party/WebKit/public/web/WebPopupMenuInfo.h" | 59 #include "third_party/WebKit/public/web/WebPopupMenuInfo.h" |
60 #include "third_party/WebKit/public/web/WebRange.h" | 60 #include "third_party/WebKit/public/web/WebRange.h" |
61 #include "third_party/skia/include/core/SkShader.h" | 61 #include "third_party/skia/include/core/SkShader.h" |
62 #include "ui/base/ui_base_switches.h" | 62 #include "ui/base/ui_base_switches.h" |
63 #include "ui/gfx/frame_time.h" | 63 #include "ui/gfx/frame_time.h" |
| 64 #include "ui/gfx/point_conversions.h" |
64 #include "ui/gfx/rect_conversions.h" | 65 #include "ui/gfx/rect_conversions.h" |
65 #include "ui/gfx/size_conversions.h" | 66 #include "ui/gfx/size_conversions.h" |
66 #include "ui/gfx/skia_util.h" | 67 #include "ui/gfx/skia_util.h" |
67 #include "ui/gl/gl_switches.h" | 68 #include "ui/gl/gl_switches.h" |
68 #include "ui/surface/transport_dib.h" | 69 #include "ui/surface/transport_dib.h" |
69 | 70 |
70 #if defined(OS_ANDROID) | 71 #if defined(OS_ANDROID) |
71 #include "base/android/sys_utils.h" | 72 #include "base/android/sys_utils.h" |
72 #include "content/renderer/android/synchronous_compositor_factory.h" | 73 #include "content/renderer/android/synchronous_compositor_factory.h" |
73 #endif | 74 #endif |
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 if (!processed && input_event->type == WebInputEvent::TouchStart) { | 1129 if (!processed && input_event->type == WebInputEvent::TouchStart) { |
1129 const WebTouchEvent& touch_event = | 1130 const WebTouchEvent& touch_event = |
1130 *static_cast<const WebTouchEvent*>(input_event); | 1131 *static_cast<const WebTouchEvent*>(input_event); |
1131 // Hit-test for all the pressed touch points. If there is a touch-handler | 1132 // Hit-test for all the pressed touch points. If there is a touch-handler |
1132 // for any of the touch points, then the renderer should continue to receive | 1133 // for any of the touch points, then the renderer should continue to receive |
1133 // touch events. | 1134 // touch events. |
1134 ack_result = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 1135 ack_result = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
1135 for (size_t i = 0; i < touch_event.touchesLength; ++i) { | 1136 for (size_t i = 0; i < touch_event.touchesLength; ++i) { |
1136 if (touch_event.touches[i].state == WebTouchPoint::StatePressed && | 1137 if (touch_event.touches[i].state == WebTouchPoint::StatePressed && |
1137 HasTouchEventHandlersAt( | 1138 HasTouchEventHandlersAt( |
1138 blink::WebPoint(touch_event.touches[i].position.x, | 1139 gfx::ToFlooredPoint(touch_event.touches[i].position))) { |
1139 touch_event.touches[i].position.y))) { | |
1140 ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 1140 ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
1141 break; | 1141 break; |
1142 } | 1142 } |
1143 } | 1143 } |
1144 } | 1144 } |
1145 | 1145 |
1146 bool event_type_can_be_rate_limited = | 1146 bool event_type_can_be_rate_limited = |
1147 input_event->type == WebInputEvent::MouseMove || | 1147 input_event->type == WebInputEvent::MouseMove || |
1148 input_event->type == WebInputEvent::MouseWheel || | 1148 input_event->type == WebInputEvent::MouseWheel || |
1149 input_event->type == WebInputEvent::TouchMove; | 1149 input_event->type == WebInputEvent::TouchMove; |
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2833 | 2833 |
2834 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2834 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2835 swapped_out_frames_.AddObserver(frame); | 2835 swapped_out_frames_.AddObserver(frame); |
2836 } | 2836 } |
2837 | 2837 |
2838 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2838 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2839 swapped_out_frames_.RemoveObserver(frame); | 2839 swapped_out_frames_.RemoveObserver(frame); |
2840 } | 2840 } |
2841 | 2841 |
2842 } // namespace content | 2842 } // namespace content |
OLD | NEW |