Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: ui/events/event_utils.cc

Issue 1680613002: Adding momentum/overscroll to views:: ScrollViews Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Tableview layout. aaaand I think we are done Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/events/event_utils.h ('k') | ui/events/events_default.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/events/event_utils.h" 5 #include "ui/events/event_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "ui/display/display.h" 10 #include "ui/display/display.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 return display::Display::TOUCH_SUPPORT_UNAVAILABLE; 103 return display::Display::TOUCH_SUPPORT_UNAVAILABLE;
104 } 104 }
105 105
106 void ComputeEventLatencyOS(const base::NativeEvent& native_event) { 106 void ComputeEventLatencyOS(const base::NativeEvent& native_event) {
107 base::TimeTicks current_time = EventTimeForNow(); 107 base::TimeTicks current_time = EventTimeForNow();
108 base::TimeTicks time_stamp = EventTimeFromNative(native_event); 108 base::TimeTicks time_stamp = EventTimeFromNative(native_event);
109 base::TimeDelta delta = current_time - time_stamp; 109 base::TimeDelta delta = current_time - time_stamp;
110 110
111 EventType type = EventTypeFromNative(native_event); 111 EventType type = EventTypeFromNative(native_event);
112 switch (type) { 112 switch (type) {
113 #if defined(OS_MACOSX)
114 // ui::MouseWheelEvent is too basic to represent a NSScrollWheel event, so
115 // it is wrapped in a ui::ScrollEvent, but recorded the same in UMA.
116 case ET_SCROLL:
117 #endif
113 case ET_MOUSEWHEEL: 118 case ET_MOUSEWHEEL:
114 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.MOUSE_WHEEL", 119 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.MOUSE_WHEEL",
115 delta.InMicroseconds(), 1, 1000000, 50); 120 delta.InMicroseconds(), 1, 1000000, 50);
116 return; 121 return;
117 case ET_TOUCH_MOVED: 122 case ET_TOUCH_MOVED:
118 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_MOVED", 123 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_MOVED",
119 delta.InMicroseconds(), 1, 1000000, 50); 124 delta.InMicroseconds(), 1, 1000000, 50);
120 return; 125 return;
121 case ET_TOUCH_PRESSED: 126 case ET_TOUCH_PRESSED:
122 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_PRESSED", 127 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_PRESSED",
123 delta.InMicroseconds(), 1, 1000000, 50); 128 delta.InMicroseconds(), 1, 1000000, 50);
124 return; 129 return;
125 case ET_TOUCH_RELEASED: 130 case ET_TOUCH_RELEASED:
126 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 131 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
127 delta.InMicroseconds(), 1, 1000000, 50); 132 delta.InMicroseconds(), 1, 1000000, 50);
128 return; 133 return;
129 default: 134 default:
130 return; 135 return;
131 } 136 }
132 } 137 }
133 138
134 } // namespace ui 139 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event_utils.h ('k') | ui/events/events_default.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698