| Index: ui/events/base_event_utils.cc
|
| diff --git a/ui/events/base_event_utils.cc b/ui/events/base_event_utils.cc
|
| index c8eacb161b95d28604e0aef8df2efb28ba1034b8..d4545bc45c4560dddc39c2c217a5e0045dd39914 100644
|
| --- a/ui/events/base_event_utils.cc
|
| +++ b/ui/events/base_event_utils.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "base/atomic_sequence_num.h"
|
| #include "base/command_line.h"
|
| +#include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/time/time.h"
|
| #include "build/build_config.h"
|
| @@ -43,6 +44,18 @@ bool IsSystemKeyModifier(int flags) {
|
| (EF_ALTGR_DOWN & flags) == 0;
|
| }
|
|
|
| +base::LazyInstance<std::unique_ptr<base::TickClock>>::Leaky g_tick_clock =
|
| + LAZY_INSTANCE_INITIALIZER;
|
| +
|
| +base::TimeTicks EventTimeForNow() {
|
| + return g_tick_clock.Get() ? g_tick_clock.Get()->NowTicks()
|
| + : base::TimeTicks::Now();
|
| +}
|
| +
|
| +void SetEventTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) {
|
| + g_tick_clock.Get() = std::move(tick_clock);
|
| +}
|
| +
|
| double EventTimeStampToSeconds(base::TimeTicks time_stamp) {
|
| return (time_stamp - base::TimeTicks()).InSecondsF();
|
| }
|
|
|