| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_XBOX_DATA_FETCHER_MAC_H_ | 5 #ifndef CONTENT_BROWSER_GAMEPAD_XBOX_DATA_FETCHER_MAC_H_ |
| 6 #define CONTENT_BROWSER_GAMEPAD_XBOX_DATA_FETCHER_MAC_H_ | 6 #define CONTENT_BROWSER_GAMEPAD_XBOX_DATA_FETCHER_MAC_H_ |
| 7 | 7 |
| 8 #include <CoreFoundation/CoreFoundation.h> | 8 #include <CoreFoundation/CoreFoundation.h> |
| 9 #include <IOKit/IOKitLib.h> | 9 #include <IOKit/IOKitLib.h> |
| 10 | 10 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 XboxController* ControllerForLocation(UInt32 location_id); | 158 XboxController* ControllerForLocation(UInt32 location_id); |
| 159 | 159 |
| 160 private: | 160 private: |
| 161 static void DeviceAdded(void* context, io_iterator_t iterator); | 161 static void DeviceAdded(void* context, io_iterator_t iterator); |
| 162 static void DeviceRemoved(void* context, io_iterator_t iterator); | 162 static void DeviceRemoved(void* context, io_iterator_t iterator); |
| 163 void AddController(XboxController* controller); | 163 void AddController(XboxController* controller); |
| 164 void RemoveController(XboxController* controller); | 164 void RemoveController(XboxController* controller); |
| 165 void RemoveControllerByLocationID(uint32 id); | 165 void RemoveControllerByLocationID(uint32 id); |
| 166 virtual void XboxControllerGotData(XboxController* controller, | 166 virtual void XboxControllerGotData(XboxController* controller, |
| 167 const XboxController::Data& data) OVERRIDE; | 167 const XboxController::Data& data) override; |
| 168 virtual void XboxControllerError(XboxController* controller) OVERRIDE; | 168 virtual void XboxControllerError(XboxController* controller) override; |
| 169 | 169 |
| 170 Delegate* delegate_; | 170 Delegate* delegate_; |
| 171 | 171 |
| 172 std::set<XboxController*> controllers_; | 172 std::set<XboxController*> controllers_; |
| 173 | 173 |
| 174 bool listening_; | 174 bool listening_; |
| 175 | 175 |
| 176 // port_ owns source_, so this doesn't need to be a ScopedCFTypeRef, but we | 176 // port_ owns source_, so this doesn't need to be a ScopedCFTypeRef, but we |
| 177 // do need to maintain a reference to it so we can invalidate it. | 177 // do need to maintain a reference to it so we can invalidate it. |
| 178 CFRunLoopSourceRef source_; | 178 CFRunLoopSourceRef source_; |
| 179 IONotificationPortRef port_; | 179 IONotificationPortRef port_; |
| 180 base::mac::ScopedIOObject<io_iterator_t> xbox_360_device_added_iter_; | 180 base::mac::ScopedIOObject<io_iterator_t> xbox_360_device_added_iter_; |
| 181 base::mac::ScopedIOObject<io_iterator_t> xbox_360_device_removed_iter_; | 181 base::mac::ScopedIOObject<io_iterator_t> xbox_360_device_removed_iter_; |
| 182 base::mac::ScopedIOObject<io_iterator_t> xbox_one_device_added_iter_; | 182 base::mac::ScopedIOObject<io_iterator_t> xbox_one_device_added_iter_; |
| 183 base::mac::ScopedIOObject<io_iterator_t> xbox_one_device_removed_iter_; | 183 base::mac::ScopedIOObject<io_iterator_t> xbox_one_device_removed_iter_; |
| 184 | 184 |
| 185 DISALLOW_COPY_AND_ASSIGN(XboxDataFetcher); | 185 DISALLOW_COPY_AND_ASSIGN(XboxDataFetcher); |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 #endif // CONTENT_BROWSER_GAMEPAD_XBOX_DATA_FETCHER_MAC_H_ | 188 #endif // CONTENT_BROWSER_GAMEPAD_XBOX_DATA_FETCHER_MAC_H_ |
| OLD | NEW |