diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-07 21:32:13 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-07 21:32:13 +0000 |
commit | 6a4d7f6028cb493847f51128adf26686c5926d57 (patch) | |
tree | ec81722c55682f0fa8b6d9cef5bab31ceecdc1b7 /ash/drag_drop | |
parent | 33662e580e090d3e5909ed87e124434ac37e1e23 (diff) | |
download | chromium_src-6a4d7f6028cb493847f51128adf26686c5926d57.zip chromium_src-6a4d7f6028cb493847f51128adf26686c5926d57.tar.gz chromium_src-6a4d7f6028cb493847f51128adf26686c5926d57.tar.bz2 |
Track input latency with UMA stats
BUG=None
TEST=None
Review URL: https://codereview.chromium.org/11591006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/drag_drop')
-rw-r--r-- | ash/drag_drop/drag_drop_controller.cc | 12 | ||||
-rw-r--r-- | ash/drag_drop/drag_drop_controller_unittest.cc | 12 |
2 files changed, 18 insertions, 6 deletions
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc index 5d1611e..77fbd79 100644 --- a/ash/drag_drop/drag_drop_controller.cc +++ b/ash/drag_drop/drag_drop_controller.cc @@ -21,6 +21,7 @@ #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" #include "ui/base/events/event.h" +#include "ui/base/events/event_utils.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" #include "ui/gfx/rect_conversions.h" @@ -64,9 +65,14 @@ gfx::Rect AdjustDragImageBoundsForScaleAndOffset( void DispatchGestureEndToWindow(aura::Window* window) { if (window && window->delegate()) { - ui::GestureEvent gesture_end(ui::ET_GESTURE_END, 0, 0, 0, - base::Time::Now() - base::Time::FromDoubleT(0), - ui::GestureEventDetails(ui::ET_GESTURE_END, 0, 0), 0); + ui::GestureEvent gesture_end( + ui::ET_GESTURE_END, + 0, + 0, + 0, + ui::EventTimeForNow(), + ui::GestureEventDetails(ui::ET_GESTURE_END, 0, 0), + 0); window->delegate()->OnGestureEvent(&gesture_end); } } diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc index 2af2905..f52893a 100644 --- a/ash/drag_drop/drag_drop_controller_unittest.cc +++ b/ash/drag_drop/drag_drop_controller_unittest.cc @@ -19,6 +19,7 @@ #include "ui/base/dragdrop/drag_utils.h" #include "ui/base/dragdrop/os_exchange_data.h" #include "ui/base/events/event.h" +#include "ui/base/events/event_utils.h" #include "ui/base/gestures/gesture_types.h" #include "ui/base/ui_base_switches.h" #include "ui/gfx/image/image_skia_rep.h" @@ -266,9 +267,14 @@ void AddViewToWidgetAndResize(views::Widget* widget, views::View* view) { } void DispatchGesture(ui::EventType gesture_type, gfx::Point location) { - ui::GestureEvent gesture_event(gesture_type, location.x(), location.y(), 0, - base::Time::NowFromSystemTime() - base::Time(), - ui::GestureEventDetails(gesture_type, 0, 0), 1); + ui::GestureEvent gesture_event( + gesture_type, + location.x(), + location.y(), + 0, + ui::EventTimeForNow(), + ui::GestureEventDetails(gesture_type, 0, 0), + 1); Shell::GetPrimaryRootWindow()->DispatchGestureEvent(&gesture_event); } |