OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_EVENTS_EVENT_H_ | 5 #ifndef UI_EVENTS_EVENT_H_ |
6 #define UI_EVENTS_EVENT_H_ | 6 #define UI_EVENTS_EVENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 void set_time_stamp(const base::TimeDelta& time_stamp) { | 213 void set_time_stamp(const base::TimeDelta& time_stamp) { |
214 time_stamp_ = time_stamp; | 214 time_stamp_ = time_stamp; |
215 } | 215 } |
216 | 216 |
217 void set_name(const std::string& name) { name_ = name; } | 217 void set_name(const std::string& name) { name_ = name; } |
218 | 218 |
219 private: | 219 private: |
220 friend class EventTestApi; | 220 friend class EventTestApi; |
221 | 221 |
222 // Safely initializes the native event members of this class. | |
223 void Init(); | |
224 void InitWithNativeEvent(const base::NativeEvent& native_event); | |
225 | |
226 EventType type_; | 222 EventType type_; |
227 std::string name_; | 223 std::string name_; |
228 base::TimeDelta time_stamp_; | 224 base::TimeDelta time_stamp_; |
229 LatencyInfo latency_; | 225 LatencyInfo latency_; |
230 int flags_; | 226 int flags_; |
231 base::NativeEvent native_event_; | 227 base::NativeEvent native_event_; |
232 bool delete_native_event_; | 228 bool delete_native_event_; |
233 bool cancelable_; | 229 bool cancelable_; |
234 EventTarget* target_; | 230 EventTarget* target_; |
235 EventPhase phase_; | 231 EventPhase phase_; |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 // The set of indices of ones in the binary representation of | 688 // The set of indices of ones in the binary representation of |
693 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. | 689 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. |
694 // This value is stored as a bitfield because the number of touch ids varies, | 690 // This value is stored as a bitfield because the number of touch ids varies, |
695 // but we currently don't need more than 32 touches at a time. | 691 // but we currently don't need more than 32 touches at a time. |
696 const unsigned int touch_ids_bitfield_; | 692 const unsigned int touch_ids_bitfield_; |
697 }; | 693 }; |
698 | 694 |
699 } // namespace ui | 695 } // namespace ui |
700 | 696 |
701 #endif // UI_EVENTS_EVENT_H_ | 697 #endif // UI_EVENTS_EVENT_H_ |
OLD | NEW |