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_PROVIDER_H_ | 5 #ifndef CONTENT_BROWSER_GAMEPAD_GAMEPAD_PROVIDER_H_ |
6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_PROVIDER_H_ | 6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_PROVIDER_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // Pause and resume the background polling thread. Can be called from any | 49 // Pause and resume the background polling thread. Can be called from any |
50 // thread. | 50 // thread. |
51 void Pause(); | 51 void Pause(); |
52 void Resume(); | 52 void Resume(); |
53 | 53 |
54 // Registers the given closure for calling when the user has interacted with | 54 // Registers the given closure for calling when the user has interacted with |
55 // the device. This callback will only be issued once. | 55 // the device. This callback will only be issued once. |
56 void RegisterForUserGesture(const base::Closure& closure); | 56 void RegisterForUserGesture(const base::Closure& closure); |
57 | 57 |
58 // base::SystemMonitor::DevicesChangedObserver implementation. | 58 // base::SystemMonitor::DevicesChangedObserver implementation. |
59 virtual void OnDevicesChanged(base::SystemMonitor::DeviceType type) OVERRIDE; | 59 virtual void OnDevicesChanged(base::SystemMonitor::DeviceType type) override; |
60 | 60 |
61 private: | 61 private: |
62 void Initialize(scoped_ptr<GamepadDataFetcher> fetcher); | 62 void Initialize(scoped_ptr<GamepadDataFetcher> fetcher); |
63 | 63 |
64 // Method for setting up the platform-specific data fetcher. Takes ownership | 64 // Method for setting up the platform-specific data fetcher. Takes ownership |
65 // of |fetcher|. | 65 // of |fetcher|. |
66 void DoInitializePollingThread(scoped_ptr<GamepadDataFetcher> fetcher); | 66 void DoInitializePollingThread(scoped_ptr<GamepadDataFetcher> fetcher); |
67 | 67 |
68 // Method for sending pause hints to the low-level data fetcher. Runs on | 68 // Method for sending pause hints to the low-level data fetcher. Runs on |
69 // polling_thread_. | 69 // polling_thread_. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 scoped_ptr<base::Thread> polling_thread_; | 158 scoped_ptr<base::Thread> polling_thread_; |
159 | 159 |
160 static GamepadProvider* instance_; | 160 static GamepadProvider* instance_; |
161 | 161 |
162 DISALLOW_COPY_AND_ASSIGN(GamepadProvider); | 162 DISALLOW_COPY_AND_ASSIGN(GamepadProvider); |
163 }; | 163 }; |
164 | 164 |
165 } // namespace content | 165 } // namespace content |
166 | 166 |
167 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_PROVIDER_H_ | 167 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_PROVIDER_H_ |
OLD | NEW |