Chromium Code Reviews| Index: content/browser/gamepad/xbox_data_fetcher_mac.h |
| diff --git a/content/browser/gamepad/xbox_data_fetcher_mac.h b/content/browser/gamepad/xbox_data_fetcher_mac.h |
| index 599a63cf6cdb745d89dbd911e043c212017fff05..fae63d1e4a9af31becb36e17a52e3db3febee12f 100644 |
| --- a/content/browser/gamepad/xbox_data_fetcher_mac.h |
| +++ b/content/browser/gamepad/xbox_data_fetcher_mac.h |
| @@ -17,6 +17,12 @@ |
| #include "base/mac/scoped_ioplugininterface.h" |
| #include "base/macros.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "content/browser/gamepad/gamepad_data_fetcher.h" |
| + |
| +struct IOUSBDeviceStruct320; |
| +struct IOUSBInterfaceStruct300; |
| + |
| +namespace content { |
| class XboxController { |
| public: |
| @@ -101,11 +107,11 @@ class XboxController { |
| // Handle for the USB device. IOUSBDeviceStruct320 is the latest version of |
| // the device API that is supported on Mac OS 10.6. |
| - base::mac::ScopedIOPluginInterface<struct IOUSBDeviceStruct320> device_; |
| + base::mac::ScopedIOPluginInterface<IOUSBDeviceStruct320> device_; |
| // Handle for the interface on the device which sends button and analog data. |
| // The other interfaces (for the ChatPad and headset) are ignored. |
| - base::mac::ScopedIOPluginInterface<struct IOUSBInterfaceStruct300> interface_; |
| + base::mac::ScopedIOPluginInterface<IOUSBInterfaceStruct300> interface_; |
| bool device_is_open_; |
| bool interface_is_open_; |
| @@ -136,18 +142,13 @@ class XboxController { |
| DISALLOW_COPY_AND_ASSIGN(XboxController); |
| }; |
| -class XboxDataFetcher : public XboxController::Delegate { |
| +class XboxDataFetcher : public GamepadDataFetcher, |
| + public XboxController::Delegate { |
| public: |
| - class Delegate { |
| - public: |
| - virtual void XboxDeviceAdd(XboxController* device) = 0; |
| - virtual void XboxDeviceRemove(XboxController* device) = 0; |
| - virtual void XboxValueChanged(XboxController* device, |
| - const XboxController::Data& data) = 0; |
| - }; |
| + XboxDataFetcher(); |
| + ~XboxDataFetcher() override; |
| - explicit XboxDataFetcher(Delegate* delegate); |
| - virtual ~XboxDataFetcher(); |
| + void GetGamepadData(bool devices_changed_hint) override; |
| bool RegisterForNotifications(); |
| bool RegisterForDeviceNotifications( |
| @@ -162,6 +163,7 @@ class XboxDataFetcher : public XboxController::Delegate { |
| private: |
| static void DeviceAdded(void* context, io_iterator_t iterator); |
| static void DeviceRemoved(void* context, io_iterator_t iterator); |
| + void OnAddedToProvider() override; |
| void AddController(XboxController* controller); |
| void RemoveController(XboxController* controller); |
| void RemoveControllerByLocationID(uint32_t id); |
| @@ -169,7 +171,7 @@ class XboxDataFetcher : public XboxController::Delegate { |
| const XboxController::Data& data) override; |
| void XboxControllerError(XboxController* controller) override; |
| - Delegate* delegate_; |
| + //Delegate* delegate_; |
|
scottmg
2016/01/18 22:54:52
Delete.
|
| std::set<XboxController*> controllers_; |
| @@ -187,4 +189,6 @@ class XboxDataFetcher : public XboxController::Delegate { |
| DISALLOW_COPY_AND_ASSIGN(XboxDataFetcher); |
| }; |
| +} // namespace content |
|
scottmg
2016/01/18 22:54:52
2 space before //
|
| + |
| #endif // CONTENT_BROWSER_GAMEPAD_XBOX_DATA_FETCHER_MAC_H_ |