Index: content/browser/gamepad/raw_input_data_fetcher_win.h |
diff --git a/content/browser/gamepad/raw_input_data_fetcher_win.h b/content/browser/gamepad/raw_input_data_fetcher_win.h |
index 69b780d5793ac67e13e95985bd378fbd19c9ac8e..e8e742d519e43c9353a0f9d626491fb8f1e09002 100644 |
--- a/content/browser/gamepad/raw_input_data_fetcher_win.h |
+++ b/content/browser/gamepad/raw_input_data_fetcher_win.h |
@@ -40,6 +40,8 @@ struct RawGamepadInfo { |
RawGamepadInfo(); |
~RawGamepadInfo(); |
+ int source_id; |
+ int enumeration_id; |
HANDLE handle; |
scoped_ptr<uint8_t[]> ppd_buffer; |
PHIDP_PREPARSED_DATA preparsed_data; |
@@ -58,7 +60,8 @@ struct RawGamepadInfo { |
}; |
class RawInputDataFetcher |
- : public base::SupportsWeakPtr<RawInputDataFetcher>, |
+ : public GamepadDataFetcher, |
+ public base::SupportsWeakPtr<RawInputDataFetcher>, |
public base::MessageLoop::DestructionObserver { |
public: |
explicit RawInputDataFetcher(); |
@@ -67,14 +70,15 @@ class RawInputDataFetcher |
// DestructionObserver overrides. |
void WillDestroyCurrentMessageLoop() override; |
- bool Available() { return rawinput_available_; } |
- void StartMonitor(); |
- void StopMonitor(); |
- |
- std::vector<RawGamepadInfo*> EnumerateDevices(); |
- RawGamepadInfo* GetGamepadInfo(HANDLE handle); |
+ void GetGamepadData(bool devices_changed_hint) override; |
+ void PauseHint(bool paused) override; |
private: |
+ void OnAddedToProvider() override; |
+ |
+ void StartMonitor(); |
+ void StopMonitor(); |
+ void EnumerateDevices(); |
RawGamepadInfo* ParseGamepadInfo(HANDLE hDevice); |
void UpdateGamepad(RAWINPUT* input, RawGamepadInfo* gamepad_info); |
// Handles WM_INPUT messages. |
@@ -124,8 +128,11 @@ class RawInputDataFetcher |
bool rawinput_available_; |
bool filter_xinput_; |
bool events_monitored_; |
+ int last_source_id_; |
+ int last_enumeration_id_; |
- std::map<HANDLE, RawGamepadInfo*> controllers_; |
+ typedef std::map<HANDLE, RawGamepadInfo*> ControllerMap; |
+ ControllerMap controllers_; |
// Function pointers to HID functionality, retrieved in |
// |GetHidDllFunctions|. |