| 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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 } | 983 } |
| 984 | 984 |
| 985 void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo( | 985 void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo( |
| 986 const blink::WebGestureEvent& gesture_event, | 986 const blink::WebGestureEvent& gesture_event, |
| 987 const ui::LatencyInfo& ui_latency) { | 987 const ui::LatencyInfo& ui_latency) { |
| 988 TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardGestureEvent"); | 988 TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardGestureEvent"); |
| 989 // Early out if necessary, prior to performing latency logic. | 989 // Early out if necessary, prior to performing latency logic. |
| 990 if (IgnoreInputEvents()) | 990 if (IgnoreInputEvents()) |
| 991 return; | 991 return; |
| 992 | 992 |
| 993 if (delegate_->PreHandleGestureEvent(gesture_event)) |
| 994 return; |
| 995 |
| 993 ui::LatencyInfo latency_info = | 996 ui::LatencyInfo latency_info = |
| 994 CreateRWHLatencyInfoIfNotExist(&ui_latency, gesture_event.type); | 997 CreateRWHLatencyInfoIfNotExist(&ui_latency, gesture_event.type); |
| 995 | 998 |
| 996 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate) { | 999 if (gesture_event.type == blink::WebInputEvent::GestureScrollUpdate) { |
| 997 latency_info.AddLatencyNumber( | 1000 latency_info.AddLatencyNumber( |
| 998 ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT, | 1001 ui::INPUT_EVENT_LATENCY_SCROLL_UPDATE_RWH_COMPONENT, |
| 999 GetLatencyComponentId(), | 1002 GetLatencyComponentId(), |
| 1000 ++last_input_number_); | 1003 ++last_input_number_); |
| 1001 | 1004 |
| 1002 // Make a copy of the INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT with a | 1005 // Make a copy of the INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT with a |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2513 } | 2516 } |
| 2514 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); | 2517 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From(rwh); |
| 2515 if (rwhi_set.insert(rwhi).second) | 2518 if (rwhi_set.insert(rwhi).second) |
| 2516 rwhi->FrameSwapped(latency_info[i]); | 2519 rwhi->FrameSwapped(latency_info[i]); |
| 2517 } | 2520 } |
| 2518 } | 2521 } |
| 2519 } | 2522 } |
| 2520 } | 2523 } |
| 2521 | 2524 |
| 2522 } // namespace content | 2525 } // namespace content |
| OLD | NEW |