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

Unified Diff: ui/events/cocoa/events_mac.mm

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/blink/blink_event_util_unittest.cc ('k') | ui/events/event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/cocoa/events_mac.mm
diff --git a/ui/events/cocoa/events_mac.mm b/ui/events/cocoa/events_mac.mm
index 55edba342f2f0091c27161563da98bed34b0eeba..8b4cde2fabcb5097eee7d3877062e14f6d709490 100644
--- a/ui/events/cocoa/events_mac.mm
+++ b/ui/events/cocoa/events_mac.mm
@@ -12,6 +12,7 @@
#import "base/mac/sdk_forward_declarations.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "ui/events/base_event_utils.h"
#include "ui/events/cocoa/cocoa_event_utils.h"
#include "ui/events/event_utils.h"
#import "ui/events/keycodes/keyboard_code_conversion_mac.h"
@@ -77,14 +78,14 @@ int EventFlagsFromNative(const base::NativeEvent& event) {
return EventFlagsFromNSEventWithModifiers(event, modifiers);
}
-base::TimeDelta EventTimeFromNative(const base::NativeEvent& native_event) {
+base::TimeTicks EventTimeFromNative(const base::NativeEvent& native_event) {
NSTimeInterval since_system_startup = [native_event timestamp];
// Truncate to extract seconds before doing floating point arithmetic.
int64_t seconds = since_system_startup;
since_system_startup -= seconds;
int64_t microseconds = since_system_startup * 1000000;
- return base::TimeDelta::FromSeconds(seconds) +
- base::TimeDelta::FromMicroseconds(microseconds);
+ return ui::EventTimeStampFromSeconds(seconds) +
+ base::TimeDelta::FromMicroseconds(microseconds);
}
gfx::Point EventLocationFromNative(const base::NativeEvent& native_event) {
« no previous file with comments | « ui/events/blink/blink_event_util_unittest.cc ('k') | ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698