Chromium Code Reviews| Index: ui/events/event.h |
| diff --git a/ui/events/event.h b/ui/events/event.h |
| index 34944fd78296825013486e4fec87c8c3cc96b7ba..3ffc6d9d426eea02b3ec8f32c6768f2703888d79 100644 |
| --- a/ui/events/event.h |
| +++ b/ui/events/event.h |
| @@ -77,7 +77,7 @@ class EVENTS_EXPORT Event { |
| EventType type() const { return type_; } |
| const std::string& name() const { return name_; } |
| // time_stamp represents time since machine was booted. |
| - const base::TimeDelta& time_stamp() const { return time_stamp_; } |
| + const base::TimeTicks& time_stamp() const { return time_stamp_; } |
|
miu
2016/05/16 20:05:35
nit (Chromium style): Pass-by-value instead of by-
majidvp
2016/05/21 01:38:00
Done. Though I couldn't find the directive to pref
miu
2016/05/25 01:42:31
Oh, sorry. Here's a link to the relevant header fi
|
| int flags() const { return flags_; } |
| // This is only intended to be used externally by classes that are modifying |
| @@ -282,13 +282,13 @@ class EVENTS_EXPORT Event { |
| bool handled() const { return result_ != ER_UNHANDLED; } |
| protected: |
| - Event(EventType type, base::TimeDelta time_stamp, int flags); |
| + Event(EventType type, base::TimeTicks time_stamp, int flags); |
| Event(const base::NativeEvent& native_event, EventType type, int flags); |
| Event(const Event& copy); |
| void SetType(EventType type); |
| void set_cancelable(bool cancelable) { cancelable_ = cancelable; } |
| - void set_time_stamp(const base::TimeDelta& time_stamp) { |
| + void set_time_stamp(const base::TimeTicks& time_stamp) { |
| time_stamp_ = time_stamp; |
| } |
| @@ -302,7 +302,7 @@ class EVENTS_EXPORT Event { |
| EventType type_; |
| std::string name_; |
| - base::TimeDelta time_stamp_; |
| + base::TimeTicks time_stamp_; |
| LatencyInfo latency_; |
| int flags_; |
| base::NativeEvent native_event_; |
| @@ -324,7 +324,7 @@ class EVENTS_EXPORT CancelModeEvent : public Event { |
| private: |
| // For (de)serialization. |
| - CancelModeEvent(EventType type, base::TimeDelta time_stamp, int flags) |
| + CancelModeEvent(EventType type, base::TimeTicks time_stamp, int flags) |
| : Event(type, time_stamp, flags) {} |
| friend struct IPC::ParamTraits<ui::ScopedEvent>; |
| friend struct IPC::ParamTraits<ui::CancelModeEvent>; |
| @@ -373,7 +373,7 @@ class EVENTS_EXPORT LocatedEvent : public Event { |
| friend class LocatedEventTestApi; |
| // For (de)serialization. |
| - LocatedEvent(EventType type, base::TimeDelta time_stamp, int flags) |
| + LocatedEvent(EventType type, base::TimeTicks time_stamp, int flags) |
| : Event(type, time_stamp, flags) {} |
| friend struct IPC::ParamTraits<ui::ScopedEvent>; |
| friend struct IPC::ParamTraits<ui::LocatedEvent>; |
| @@ -395,7 +395,7 @@ class EVENTS_EXPORT LocatedEvent : public Event { |
| LocatedEvent(EventType type, |
| const gfx::PointF& location, |
| const gfx::PointF& root_location, |
| - base::TimeDelta time_stamp, |
| + base::TimeTicks time_stamp, |
| int flags); |
| gfx::PointF location_; |
| @@ -492,7 +492,7 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent { |
| MouseEvent(EventType type, |
| const gfx::Point& location, |
| const gfx::Point& root_location, |
| - base::TimeDelta time_stamp, |
| + base::TimeTicks time_stamp, |
| int flags, |
| int changed_button_flags); |
| @@ -562,7 +562,7 @@ class EVENTS_EXPORT MouseEvent : public LocatedEvent { |
| protected: |
| // For (de)serialization. |
| - MouseEvent(EventType type, base::TimeDelta time_stamp, int flags) |
| + MouseEvent(EventType type, base::TimeTicks time_stamp, int flags) |
| : LocatedEvent(type, time_stamp, flags) {} |
| friend struct IPC::ParamTraits<ui::ScopedEvent>; |
| friend struct IPC::ParamTraits<ui::MouseEvent>; |
| @@ -616,7 +616,7 @@ class EVENTS_EXPORT MouseWheelEvent : public MouseEvent { |
| MouseWheelEvent(const gfx::Vector2d& offset, |
| const gfx::Point& location, |
| const gfx::Point& root_location, |
| - base::TimeDelta time_stamp, |
| + base::TimeTicks time_stamp, |
| int flags, |
| int changed_button_flags); |
| @@ -628,7 +628,7 @@ class EVENTS_EXPORT MouseWheelEvent : public MouseEvent { |
| private: |
| // For (de)serialization. |
| - MouseWheelEvent(EventType type, base::TimeDelta time_stamp, int flags) |
| + MouseWheelEvent(EventType type, base::TimeTicks time_stamp, int flags) |
| : MouseEvent(type, time_stamp, flags) {} |
| friend struct IPC::ParamTraits<ui::ScopedEvent>; |
| friend struct IPC::ParamTraits<ui::MouseWheelEvent>; |
| @@ -656,13 +656,13 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent { |
| TouchEvent(EventType type, |
| const gfx::Point& location, |
| int touch_id, |
| - base::TimeDelta time_stamp); |
| + base::TimeTicks time_stamp); |
| TouchEvent(EventType type, |
| const gfx::Point& location, |
| int flags, |
| int touch_id, |
| - base::TimeDelta timestamp, |
| + base::TimeTicks timestamp, |
| float radius_x, |
| float radius_y, |
| float angle, |
| @@ -706,7 +706,7 @@ class EVENTS_EXPORT TouchEvent : public LocatedEvent { |
| private: |
| // For (de)serialization. |
| - TouchEvent(EventType type, base::TimeDelta time_stamp, int flags) |
| + TouchEvent(EventType type, base::TimeTicks time_stamp, int flags) |
| : LocatedEvent(type, time_stamp, flags), |
| should_remove_native_touch_id_mapping_(false) {} |
| friend struct IPC::ParamTraits<ui::ScopedEvent>; |
| @@ -760,14 +760,14 @@ class EVENTS_EXPORT PointerEvent : public LocatedEvent { |
| const gfx::Point& root_location, |
| int flags, |
| int pointer_id, |
| - base::TimeDelta time_stamp); |
| + base::TimeTicks time_stamp); |
| int32_t pointer_id() const { return pointer_id_; } |
| const PointerDetails& pointer_details() const { return details_; } |
| protected: |
| // For (de)serialization. |
| - PointerEvent(EventType type, base::TimeDelta time_stamp, int flags) |
| + PointerEvent(EventType type, base::TimeTicks time_stamp, int flags) |
| : LocatedEvent(type, time_stamp, flags) {} |
| friend struct IPC::ParamTraits<ui::ScopedEvent>; |
| friend struct IPC::ParamTraits<ui::PointerEvent>; |
| @@ -843,7 +843,7 @@ class EVENTS_EXPORT KeyEvent : public Event { |
| DomCode code, |
| int flags, |
| DomKey key, |
| - base::TimeDelta time_stamp); |
| + base::TimeTicks time_stamp); |
| // Create a character event. |
| KeyEvent(base::char16 character, KeyboardCode key_code, int flags); |
| @@ -943,7 +943,7 @@ class EVENTS_EXPORT KeyEvent : public Event { |
| private: |
| // For (de)serialization. |
| - KeyEvent(EventType type, base::TimeDelta time_stamp, int flags); |
| + KeyEvent(EventType type, base::TimeTicks time_stamp, int flags); |
| friend struct IPC::ParamTraits<ui::ScopedEvent>; |
| friend struct IPC::ParamTraits<ui::KeyEvent>; |
| @@ -1005,7 +1005,7 @@ class EVENTS_EXPORT ScrollEvent : public MouseEvent { |
| // Used for tests. |
| ScrollEvent(EventType type, |
| const gfx::Point& location, |
| - base::TimeDelta time_stamp, |
| + base::TimeTicks time_stamp, |
| int flags, |
| float x_offset, |
| float y_offset, |
| @@ -1026,7 +1026,7 @@ class EVENTS_EXPORT ScrollEvent : public MouseEvent { |
| private: |
| // For (de)serialization. |
| - ScrollEvent(EventType type, base::TimeDelta time_stamp, int flags) |
| + ScrollEvent(EventType type, base::TimeTicks time_stamp, int flags) |
| : MouseEvent(type, time_stamp, flags) {} |
| friend struct IPC::ParamTraits<ui::ScopedEvent>; |
| friend struct IPC::ParamTraits<ui::ScrollEvent>; |
| @@ -1046,7 +1046,7 @@ class EVENTS_EXPORT GestureEvent : public LocatedEvent { |
| GestureEvent(float x, |
| float y, |
| int flags, |
| - base::TimeDelta time_stamp, |
| + base::TimeTicks time_stamp, |
| const GestureEventDetails& details); |
| // Create a new GestureEvent which is identical to the provided model. |
| @@ -1064,7 +1064,7 @@ class EVENTS_EXPORT GestureEvent : public LocatedEvent { |
| private: |
| // For (de)serialization. |
| - GestureEvent(EventType type, base::TimeDelta time_stamp, int flags) |
| + GestureEvent(EventType type, base::TimeTicks time_stamp, int flags) |
| : LocatedEvent(type, time_stamp, flags) {} |
| friend struct IPC::ParamTraits<ui::ScopedEvent>; |
| friend struct IPC::ParamTraits<ui::GestureEvent>; |