| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_OZONE_GAMEPAD_GAMEPAD_EVENT_H_ | 5 #ifndef UI_EVENTS_OZONE_GAMEPAD_GAMEPAD_EVENT_H_ |
| 6 #define UI_EVENTS_OZONE_GAMEPAD_GAMEPAD_EVENT_H_ | 6 #define UI_EVENTS_OZONE_GAMEPAD_GAMEPAD_EVENT_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "ui/events/ozone/gamepad/webgamepad_constants.h" | 9 #include "ui/events/ozone/gamepad/webgamepad_constants.h" |
| 10 | 10 |
| 11 namespace ui { | 11 namespace ui { |
| 12 | 12 |
| 13 class GamepadEvent { | 13 class GamepadEvent { |
| 14 public: | 14 public: |
| 15 GamepadEvent(int device_id, | 15 GamepadEvent(int device_id, |
| 16 GamepadEventType type, | 16 GamepadEventType type, |
| 17 uint16_t code, | 17 uint16_t code, |
| 18 double value, | 18 double value, |
| 19 base::TimeTicks timestamp); | 19 base::TimeTicks timestamp); |
| 20 | 20 |
| 21 int device_id() { return device_id_; } | 21 int device_id() const { return device_id_; } |
| 22 | 22 |
| 23 GamepadEventType type() { return type_; } | 23 GamepadEventType type() const { return type_; } |
| 24 | 24 |
| 25 uint16_t code() { return code_; } | 25 uint16_t code() const { return code_; } |
| 26 | 26 |
| 27 double value() { return value_; } | 27 double value() const { return value_; } |
| 28 | 28 |
| 29 base::TimeTicks timestamp() { return timestamp_; } | 29 base::TimeTicks timestamp() const { return timestamp_; } |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 int device_id_; | 32 int device_id_; |
| 33 | 33 |
| 34 GamepadEventType type_; | 34 GamepadEventType type_; |
| 35 | 35 |
| 36 uint16_t code_; | 36 uint16_t code_; |
| 37 | 37 |
| 38 double value_; | 38 double value_; |
| 39 | 39 |
| 40 base::TimeTicks timestamp_; | 40 base::TimeTicks timestamp_; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace ui | 43 } // namespace ui |
| 44 | 44 |
| 45 #endif // UI_EVENTS_OZONE_GAMEPAD_GAMEPAD_EVENT_H_ | 45 #endif // UI_EVENTS_OZONE_GAMEPAD_GAMEPAD_EVENT_H_ |
| OLD | NEW |