| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PROVIDER_H_ | 5 #ifndef CONTENT_BROWSER_GAMEPAD_PROVIDER_H_ |
| 6 #define CONTENT_BROWSER_GAMEPAD_PROVIDER_H_ | 6 #define CONTENT_BROWSER_GAMEPAD_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| 11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
| 12 #include "base/system_monitor/system_monitor.h" | 12 #include "base/system_monitor/system_monitor.h" |
| 13 #include "base/task.h" | 13 #include "base/task.h" |
| 14 #include "content/browser/gamepad/data_fetcher.h" | 14 #include "content/browser/gamepad/data_fetcher.h" |
| 15 #include "content/common/content_export.h" |
| 15 #include "content/common/gamepad_hardware_buffer.h" | 16 #include "content/common/gamepad_hardware_buffer.h" |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class Thread; | 19 class Thread; |
| 19 } | 20 } |
| 20 | 21 |
| 21 struct GamepadMsg_Updated_Params; | 22 struct GamepadMsg_Updated_Params; |
| 22 | 23 |
| 23 namespace gamepad { | 24 namespace gamepad { |
| 24 | 25 |
| 25 class Provider : public base::RefCountedThreadSafe<Provider>, | 26 class CONTENT_EXPORT Provider : |
| 26 public base::SystemMonitor::DevicesChangedObserver { | 27 public base::RefCountedThreadSafe<Provider>, |
| 28 public base::SystemMonitor::DevicesChangedObserver { |
| 27 public: | 29 public: |
| 28 explicit Provider(DataFetcher* fetcher); | 30 explicit Provider(DataFetcher* fetcher); |
| 29 | 31 |
| 30 // Starts or Stops the provider. Called from creator_loop_. | 32 // Starts or Stops the provider. Called from creator_loop_. |
| 31 void Start(); | 33 void Start(); |
| 32 void Stop(); | 34 void Stop(); |
| 33 base::SharedMemoryHandle GetRendererSharedMemoryHandle( | 35 base::SharedMemoryHandle GetRendererSharedMemoryHandle( |
| 34 base::ProcessHandle renderer_process); | 36 base::ProcessHandle renderer_process); |
| 35 | 37 |
| 36 private: | 38 private: |
| (...skipping 30 matching lines...) Expand all Loading... |
| 67 | 69 |
| 68 static Provider* instance_; | 70 static Provider* instance_; |
| 69 base::WeakPtrFactory<Provider> weak_factory_; | 71 base::WeakPtrFactory<Provider> weak_factory_; |
| 70 | 72 |
| 71 DISALLOW_COPY_AND_ASSIGN(Provider); | 73 DISALLOW_COPY_AND_ASSIGN(Provider); |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 } // namespace gamepad | 76 } // namespace gamepad |
| 75 | 77 |
| 76 #endif // CONTENT_BROWSER_GAMEPAD_PROVIDER_H_ | 78 #endif // CONTENT_BROWSER_GAMEPAD_PROVIDER_H_ |
| OLD | NEW |