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

Unified Diff: ui/events/base_event_utils.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/base_event_utils.h ('k') | ui/events/blink/blink_event_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/events/base_event_utils.h ('k') | ui/events/blink/blink_event_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698