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

Side by Side Diff: ash/touch/touch_uma.cc

Issue 1975533002: Change ui::Event::time_stamp from TimeDelta to TimeTicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 | « ash/touch/touch_uma.h ('k') | ash/wm/gestures/overview_gesture_handler_unittest.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 "ash/touch/touch_uma.h" 5 #include "ash/touch/touch_uma.h"
6 6
7 #include "ash/metrics/user_metrics_recorder.h" 7 #include "ash/metrics/user_metrics_recorder.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
11 #include "ui/aura/env.h" 11 #include "ui/aura/env.h"
12 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
13 #include "ui/aura/window_event_dispatcher.h" 13 #include "ui/aura/window_event_dispatcher.h"
14 #include "ui/aura/window_property.h" 14 #include "ui/aura/window_property.h"
15 #include "ui/events/event.h" 15 #include "ui/events/event.h"
16 #include "ui/events/event_utils.h" 16 #include "ui/events/event_utils.h"
17 #include "ui/gfx/geometry/point_conversions.h" 17 #include "ui/gfx/geometry/point_conversions.h"
18 18
19 #if defined(USE_X11) 19 #if defined(USE_X11)
20 #include <X11/extensions/XInput2.h> 20 #include <X11/extensions/XInput2.h>
21 #include <X11/Xlib.h> 21 #include <X11/Xlib.h>
22 #endif 22 #endif
23 23
24 namespace { 24 namespace {
25 25
26 struct WindowTouchDetails { 26 struct WindowTouchDetails {
27 // Move and start times of the touch points. The key is the touch-id. 27 // Move and start times of the touch points. The key is the touch-id.
28 std::map<int, base::TimeDelta> last_move_time_; 28 std::map<int, base::TimeTicks> last_move_time_;
29 std::map<int, base::TimeDelta> last_start_time_; 29 std::map<int, base::TimeTicks> last_start_time_;
30 30
31 // The first and last positions of the touch points. 31 // The first and last positions of the touch points.
32 std::map<int, gfx::Point> start_touch_position_; 32 std::map<int, gfx::Point> start_touch_position_;
33 std::map<int, gfx::Point> last_touch_position_; 33 std::map<int, gfx::Point> last_touch_position_;
34 34
35 // Last time-stamp of the last touch-end event. 35 // Last time-stamp of the last touch-end event.
36 base::TimeDelta last_release_time_; 36 base::TimeTicks last_release_time_;
37 37
38 // Stores the time of the last touch released on this window (if there was a 38 // Stores the time of the last touch released on this window (if there was a
39 // multi-touch gesture on the window, then this is the release-time of the 39 // multi-touch gesture on the window, then this is the release-time of the
40 // last touch on the window). 40 // last touch on the window).
41 base::TimeDelta last_mt_time_; 41 base::TimeTicks last_mt_time_;
42 }; 42 };
43 43
44 DEFINE_OWNED_WINDOW_PROPERTY_KEY(WindowTouchDetails, 44 DEFINE_OWNED_WINDOW_PROPERTY_KEY(WindowTouchDetails,
45 kWindowTouchDetails, 45 kWindowTouchDetails,
46 NULL); 46 NULL);
47 } 47 }
48 48
49 DECLARE_WINDOW_PROPERTY_TYPE(WindowTouchDetails*); 49 DECLARE_WINDOW_PROPERTY_TYPE(WindowTouchDetails*);
50 50
51 namespace ash { 51 namespace ash {
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 return GESTURE_OMNIBOX_SCROLL; 299 return GESTURE_OMNIBOX_SCROLL;
300 if (event.type() == ui::ET_GESTURE_PINCH_BEGIN) 300 if (event.type() == ui::ET_GESTURE_PINCH_BEGIN)
301 return GESTURE_OMNIBOX_PINCH; 301 return GESTURE_OMNIBOX_PINCH;
302 return GESTURE_UNKNOWN; 302 return GESTURE_UNKNOWN;
303 } 303 }
304 304
305 return GESTURE_UNKNOWN; 305 return GESTURE_UNKNOWN;
306 } 306 }
307 307
308 } // namespace ash 308 } // namespace ash
OLDNEW
« no previous file with comments | « ash/touch/touch_uma.h ('k') | ash/wm/gestures/overview_gesture_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698