| 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 const blink::WebMouseWheelEvent& wheel_event, | 966 const blink::WebMouseWheelEvent& wheel_event, |
| 967 const ui::LatencyInfo& ui_latency) { | 967 const ui::LatencyInfo& ui_latency) { |
| 968 TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardWheelEvent"); | 968 TRACE_EVENT0("input", "RenderWidgetHostImpl::ForwardWheelEvent"); |
| 969 | 969 |
| 970 ui::LatencyInfo latency_info = | 970 ui::LatencyInfo latency_info = |
| 971 CreateRWHLatencyInfoIfNotExist(&ui_latency, wheel_event.type); | 971 CreateRWHLatencyInfoIfNotExist(&ui_latency, wheel_event.type); |
| 972 | 972 |
| 973 if (IgnoreInputEvents()) | 973 if (IgnoreInputEvents()) |
| 974 return; | 974 return; |
| 975 | 975 |
| 976 if (delegate_->PreHandleWheelEvent(wheel_event)) | |
| 977 return; | |
| 978 | |
| 979 input_router_->SendWheelEvent(MouseWheelEventWithLatencyInfo(wheel_event, | 976 input_router_->SendWheelEvent(MouseWheelEventWithLatencyInfo(wheel_event, |
| 980 latency_info)); | 977 latency_info)); |
| 981 } | 978 } |
| 982 | 979 |
| 983 void RenderWidgetHostImpl::ForwardGestureEvent( | 980 void RenderWidgetHostImpl::ForwardGestureEvent( |
| 984 const blink::WebGestureEvent& gesture_event) { | 981 const blink::WebGestureEvent& gesture_event) { |
| 985 ForwardGestureEventWithLatencyInfo(gesture_event, ui::LatencyInfo()); | 982 ForwardGestureEventWithLatencyInfo(gesture_event, ui::LatencyInfo()); |
| 986 } | 983 } |
| 987 | 984 |
| 988 void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo( | 985 void RenderWidgetHostImpl::ForwardGestureEventWithLatencyInfo( |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2055 if (!wheel_event.latency.FindLatency( | 2052 if (!wheel_event.latency.FindLatency( |
| 2056 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) { | 2053 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) { |
| 2057 // MouseWheelEvent latency ends when it is acked but does not cause any | 2054 // MouseWheelEvent latency ends when it is acked but does not cause any |
| 2058 // rendering scheduled. | 2055 // rendering scheduled. |
| 2059 ui::LatencyInfo latency = wheel_event.latency; | 2056 ui::LatencyInfo latency = wheel_event.latency; |
| 2060 latency.AddLatencyNumber( | 2057 latency.AddLatencyNumber( |
| 2061 ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT, 0, 0); | 2058 ui::INPUT_EVENT_LATENCY_TERMINATED_MOUSE_COMPONENT, 0, 0); |
| 2062 } | 2059 } |
| 2063 | 2060 |
| 2064 const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result); | 2061 const bool processed = (INPUT_EVENT_ACK_STATE_CONSUMED == ack_result); |
| 2065 if (!processed && !is_hidden() && view_) | 2062 if (!processed && !is_hidden() && view_) { |
| 2066 view_->UnhandledWheelEvent(wheel_event.event); | 2063 if (!delegate_->HandleWheelEvent(wheel_event.event)) |
| 2064 view_->UnhandledWheelEvent(wheel_event.event); |
| 2065 } |
| 2067 } | 2066 } |
| 2068 | 2067 |
| 2069 void RenderWidgetHostImpl::OnGestureEventAck( | 2068 void RenderWidgetHostImpl::OnGestureEventAck( |
| 2070 const GestureEventWithLatencyInfo& event, | 2069 const GestureEventWithLatencyInfo& event, |
| 2071 InputEventAckState ack_result) { | 2070 InputEventAckState ack_result) { |
| 2072 if (!event.latency.FindLatency( | 2071 if (!event.latency.FindLatency( |
| 2073 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) { | 2072 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) { |
| 2074 // GestureEvent latency ends when it is acked but does not cause any | 2073 // GestureEvent latency ends when it is acked but does not cause any |
| 2075 // rendering scheduled. | 2074 // rendering scheduled. |
| 2076 ui::LatencyInfo latency = event.latency; | 2075 ui::LatencyInfo latency = event.latency; |
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2542 } | 2541 } |
| 2543 } | 2542 } |
| 2544 | 2543 |
| 2545 // Add newly generated components into the latency info | 2544 // Add newly generated components into the latency info |
| 2546 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { | 2545 for (lc = new_components.begin(); lc != new_components.end(); ++lc) { |
| 2547 latency_info->latency_components[lc->first] = lc->second; | 2546 latency_info->latency_components[lc->first] = lc->second; |
| 2548 } | 2547 } |
| 2549 } | 2548 } |
| 2550 | 2549 |
| 2551 } // namespace content | 2550 } // namespace content |
| OLD | NEW |