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 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 if (!processed && input_event->type == WebInputEvent::TouchStart) { | 1128 if (!processed && input_event->type == WebInputEvent::TouchStart) { |
1128 const WebTouchEvent& touch_event = | 1129 const WebTouchEvent& touch_event = |
1129 *static_cast<const WebTouchEvent*>(input_event); | 1130 *static_cast<const WebTouchEvent*>(input_event); |
1130 // Hit-test for all the pressed touch points. If there is a touch-handler | 1131 // Hit-test for all the pressed touch points. If there is a touch-handler |
1131 // for any of the touch points, then the renderer should continue to receive | 1132 // for any of the touch points, then the renderer should continue to receive |
1132 // touch events. | 1133 // touch events. |
1133 ack_result = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 1134 ack_result = INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
1134 for (size_t i = 0; i < touch_event.touchesLength; ++i) { | 1135 for (size_t i = 0; i < touch_event.touchesLength; ++i) { |
1135 if (touch_event.touches[i].state == WebTouchPoint::StatePressed && | 1136 if (touch_event.touches[i].state == WebTouchPoint::StatePressed && |
1136 HasTouchEventHandlersAt( | 1137 HasTouchEventHandlersAt( |
1137 blink::WebPoint(touch_event.touches[i].position.x, | 1138 gfx::ToFlooredPoint(touch_event.touches[i].position))) { |
1138 touch_event.touches[i].position.y))) { | |
1139 ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 1139 ack_result = INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
1140 break; | 1140 break; |
1141 } | 1141 } |
1142 } | 1142 } |
1143 } | 1143 } |
1144 | 1144 |
1145 bool event_type_can_be_rate_limited = | 1145 bool event_type_can_be_rate_limited = |
1146 input_event->type == WebInputEvent::MouseMove || | 1146 input_event->type == WebInputEvent::MouseMove || |
1147 input_event->type == WebInputEvent::MouseWheel || | 1147 input_event->type == WebInputEvent::MouseWheel || |
1148 input_event->type == WebInputEvent::TouchMove; | 1148 input_event->type == WebInputEvent::TouchMove; |
(...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2784 | 2784 |
2785 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2785 void RenderWidget::RegisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2786 swapped_out_frames_.AddObserver(frame); | 2786 swapped_out_frames_.AddObserver(frame); |
2787 } | 2787 } |
2788 | 2788 |
2789 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { | 2789 void RenderWidget::UnregisterSwappedOutChildFrame(RenderFrameImpl* frame) { |
2790 swapped_out_frames_.RemoveObserver(frame); | 2790 swapped_out_frames_.RemoveObserver(frame); |
2791 } | 2791 } |
2792 | 2792 |
2793 } // namespace content | 2793 } // namespace content |
OLD | NEW |