Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: device/gamepad/gamepad_data_fetcher_manager.h

Issue 2129003002: Refactored gamepad polling to support dynamic sources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit test issue and Mac XBoxDataFetcher constructor Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_GAMEPAD_GAMEPAD_DATA_FETCHER_MANAGER_H_
6 #define DEVICE_GAMEPAD_GAMEPAD_DATA_FETCHER_MANAGER_H_
7
8 #include <memory>
9 #include <utility>
10 #include <vector>
11
12 #include "device/gamepad/gamepad_export.h"
13 #include "device/gamepad/gamepad_provider.h"
14
15 namespace device {
16
17 class GamepadDataFetcherFactory;
18
19 class DEVICE_GAMEPAD_EXPORT GamepadDataFetcherManager {
20 public:
21 ~GamepadDataFetcherManager();
22
23 // Returns the GamepadDataFetcherManager singleton.
24 static GamepadDataFetcherManager* GetInstance();
25
26 void AddFactory(GamepadDataFetcherFactory* factory);
27 void RemoveSourceFactory(GamepadSource source);
28
29 // Must be called on the providers polling thread
30 void InitializeProvider(GamepadProvider* provider);
31 void ClearProvider();
32
33 private:
34 GamepadDataFetcherManager();
35
36 void CreateDataFetcherFromFactory(GamepadDataFetcherFactory* factory);
37 void RemoveSourceDataFetcher(GamepadSource* source);
38
39 typedef std::vector<GamepadDataFetcherFactory*> FactoryVector;
40 FactoryVector factories_;
41
42 GamepadProvider* provider_;
43 };
44
45 } // namespace device
46
47 #endif // DEVICE_GAMEPAD_GAMEPAD_DATA_FETCHER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698