| 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 CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_ | 5 #ifndef CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_ |
| 6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_ | 6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 virtual ~GamepadService(); | 99 virtual ~GamepadService(); |
| 100 | 100 |
| 101 static void SetInstance(GamepadService*); | 101 static void SetInstance(GamepadService*); |
| 102 | 102 |
| 103 void OnUserGesture(); | 103 void OnUserGesture(); |
| 104 | 104 |
| 105 void OnGamepadConnectionChange(bool connected, | 105 void OnGamepadConnectionChange(bool connected, |
| 106 int index, | 106 int index, |
| 107 const blink::WebGamepad& pad) override; | 107 const blink::WebGamepad& pad) override; |
| 108 | 108 |
| 109 void SetSanitizationEnabled(bool sanitize); |
| 110 |
| 109 struct ConsumerInfo { | 111 struct ConsumerInfo { |
| 110 ConsumerInfo(device::GamepadConsumer* consumer) | 112 ConsumerInfo(device::GamepadConsumer* consumer) |
| 111 : consumer(consumer), did_observe_user_gesture(false) {} | 113 : consumer(consumer), did_observe_user_gesture(false) {} |
| 112 | 114 |
| 113 bool operator<(const ConsumerInfo& other) const { | 115 bool operator<(const ConsumerInfo& other) const { |
| 114 return consumer < other.consumer; | 116 return consumer < other.consumer; |
| 115 } | 117 } |
| 116 | 118 |
| 117 device::GamepadConsumer* consumer; | 119 device::GamepadConsumer* consumer; |
| 118 mutable bool is_active; | 120 mutable bool is_active; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 129 int num_active_consumers_; | 131 int num_active_consumers_; |
| 130 | 132 |
| 131 bool gesture_callback_pending_; | 133 bool gesture_callback_pending_; |
| 132 | 134 |
| 133 DISALLOW_COPY_AND_ASSIGN(GamepadService); | 135 DISALLOW_COPY_AND_ASSIGN(GamepadService); |
| 134 }; | 136 }; |
| 135 | 137 |
| 136 } // namespace content | 138 } // namespace content |
| 137 | 139 |
| 138 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_ | 140 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_SERVICE_H_ |
| OLD | NEW |