Index: ui/events/base_event_utils.cc |
diff --git a/ui/events/base_event_utils.cc b/ui/events/base_event_utils.cc |
index 4da72216b1039a57c4424e04252a977e20f430dc..c8eacb161b95d28604e0aef8df2efb28ba1034b8 100644 |
--- a/ui/events/base_event_utils.cc |
+++ b/ui/events/base_event_utils.cc |
@@ -7,6 +7,7 @@ |
#include "base/atomic_sequence_num.h" |
#include "base/command_line.h" |
#include "base/logging.h" |
+#include "base/time/time.h" |
#include "build/build_config.h" |
#include "ui/events/event_constants.h" |
#include "ui/events/event_switches.h" |
@@ -42,5 +43,13 @@ bool IsSystemKeyModifier(int flags) { |
(EF_ALTGR_DOWN & flags) == 0; |
} |
+double EventTimeStampToSeconds(base::TimeTicks time_stamp) { |
+ return (time_stamp - base::TimeTicks()).InSecondsF(); |
+} |
+ |
+base::TimeTicks EventTimeStampFromSeconds(double time_stamp_seconds) { |
+ return base::TimeTicks() + base::TimeDelta::FromSecondsD(time_stamp_seconds); |
+} |
+ |
} // namespace ui |