OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/input/input_handler_proxy.h" | 5 #include "content/renderer/input/input_handler_proxy.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.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/logging.h" | 10 #include "base/logging.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 WebGestureEvent scroll_begin_event = event; | 111 WebGestureEvent scroll_begin_event = event; |
112 scroll_begin_event.type = WebInputEvent::GestureScrollBegin; | 112 scroll_begin_event.type = WebInputEvent::GestureScrollBegin; |
113 scroll_begin_event.data.scrollBegin.deltaXHint = 0; | 113 scroll_begin_event.data.scrollBegin.deltaXHint = 0; |
114 scroll_begin_event.data.scrollBegin.deltaYHint = 0; | 114 scroll_begin_event.data.scrollBegin.deltaYHint = 0; |
115 return scroll_begin_event; | 115 return scroll_begin_event; |
116 } | 116 } |
117 | 117 |
118 void SendScrollLatencyUma(const WebInputEvent& event, | 118 void SendScrollLatencyUma(const WebInputEvent& event, |
119 const ui::LatencyInfo& latency_info) { | 119 const ui::LatencyInfo& latency_info) { |
120 if (!(event.type == WebInputEvent::GestureScrollBegin || | 120 if (!(event.type == WebInputEvent::GestureScrollBegin || |
121 event.type == WebInputEvent::GestureScrollUpdate || | 121 event.type == WebInputEvent::GestureScrollUpdate)) |
122 event.type == WebInputEvent::GestureScrollUpdateWithoutPropagation)) | |
123 return; | 122 return; |
124 | 123 |
125 ui::LatencyInfo::LatencyMap::const_iterator it = | 124 ui::LatencyInfo::LatencyMap::const_iterator it = |
126 latency_info.latency_components.find(std::make_pair( | 125 latency_info.latency_components.find(std::make_pair( |
127 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0)); | 126 ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0)); |
128 | 127 |
129 if (it == latency_info.latency_components.end()) | 128 if (it == latency_info.latency_components.end()) |
130 return; | 129 return; |
131 | 130 |
132 base::TimeDelta delta = base::TimeTicks::HighResNow() - it->second.event_time; | 131 base::TimeDelta delta = base::TimeTicks::HighResNow() - it->second.event_time; |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 // trigger a scroll, e.g., with a trivial time delta between fling updates. | 886 // trigger a scroll, e.g., with a trivial time delta between fling updates. |
888 // Return true in this case to prevent early fling termination. | 887 // Return true in this case to prevent early fling termination. |
889 if (std::abs(clipped_increment.width) < kScrollEpsilon && | 888 if (std::abs(clipped_increment.width) < kScrollEpsilon && |
890 std::abs(clipped_increment.height) < kScrollEpsilon) | 889 std::abs(clipped_increment.height) < kScrollEpsilon) |
891 return true; | 890 return true; |
892 | 891 |
893 return did_scroll; | 892 return did_scroll; |
894 } | 893 } |
895 | 894 |
896 } // namespace content | 895 } // namespace content |
OLD | NEW |