| 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/touch_event_queue.h" | 5 #include "content/browser/renderer_host/touch_event_queue.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "content/browser/renderer_host/render_widget_host_impl.h" | 9 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 10 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 scoped_ptr<CoalescedWebTouchEvent> acked_event(touch_queue_.front()); | 183 scoped_ptr<CoalescedWebTouchEvent> acked_event(touch_queue_.front()); |
| 184 touch_queue_.pop_front(); | 184 touch_queue_.pop_front(); |
| 185 | 185 |
| 186 // Note that acking the touch-event may result in multiple gestures being sent | 186 // Note that acking the touch-event may result in multiple gestures being sent |
| 187 // to the renderer. | 187 // to the renderer. |
| 188 RenderWidgetHostViewPort* view = RenderWidgetHostViewPort::FromRWHV( | 188 RenderWidgetHostViewPort* view = RenderWidgetHostViewPort::FromRWHV( |
| 189 render_widget_host_->GetView()); | 189 render_widget_host_->GetView()); |
| 190 for (WebTouchEventWithLatencyList::const_iterator iter = acked_event->begin(), | 190 for (WebTouchEventWithLatencyList::const_iterator iter = acked_event->begin(), |
| 191 end = acked_event->end(); | 191 end = acked_event->end(); |
| 192 iter != end; ++iter) { | 192 iter != end; ++iter) { |
| 193 ui::LatencyInfo* latency = const_cast<ui::LatencyInfo*>(&(iter->latency)); |
| 194 latency->AddLatencyNumber( |
| 195 ui::INPUT_EVENT_LATENCY_ACKED_COMPONENT, 0, 0); |
| 196 render_widget_host_->ComputeTouchLatency(*latency); |
| 193 view->ProcessAckedTouchEvent((*iter), ack_result); | 197 view->ProcessAckedTouchEvent((*iter), ack_result); |
| 194 } | 198 } |
| 195 } | 199 } |
| 196 | 200 |
| 197 bool TouchEventQueue::ShouldForwardToRenderer( | 201 bool TouchEventQueue::ShouldForwardToRenderer( |
| 198 const WebKit::WebTouchEvent& event) const { | 202 const WebKit::WebTouchEvent& event) const { |
| 199 // Touch press events should always be forwarded to the renderer. | 203 // Touch press events should always be forwarded to the renderer. |
| 200 if (event.type == WebKit::WebInputEvent::TouchStart) | 204 if (event.type == WebKit::WebInputEvent::TouchStart) |
| 201 return true; | 205 return true; |
| 202 | 206 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 214 // If the ACK status of a point is unknown, then the event should be | 218 // If the ACK status of a point is unknown, then the event should be |
| 215 // forwarded to the renderer. | 219 // forwarded to the renderer. |
| 216 return true; | 220 return true; |
| 217 } | 221 } |
| 218 } | 222 } |
| 219 | 223 |
| 220 return false; | 224 return false; |
| 221 } | 225 } |
| 222 | 226 |
| 223 } // namespace content | 227 } // namespace content |
| OLD | NEW |