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 DEVICE_GAMEPAD_GAMEPAD_SERVICE_H_ | 5 #ifndef DEVICE_GAMEPAD_GAMEPAD_SERVICE_H_ |
6 #define DEVICE_GAMEPAD_GAMEPAD_SERVICE_H_ | 6 #define DEVICE_GAMEPAD_GAMEPAD_SERVICE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // call. | 60 // call. |
61 // | 61 // |
62 // Must be called on the I/O thread. | 62 // Must be called on the I/O thread. |
63 void RemoveConsumer(device::GamepadConsumer* consumer); | 63 void RemoveConsumer(device::GamepadConsumer* consumer); |
64 | 64 |
65 // Registers the given closure for calling when the user has interacted with | 65 // Registers the given closure for calling when the user has interacted with |
66 // the device. This callback will only be issued once. Should only be called | 66 // the device. This callback will only be issued once. Should only be called |
67 // while a consumer is active. | 67 // while a consumer is active. |
68 void RegisterForUserGesture(const base::Closure& closure); | 68 void RegisterForUserGesture(const base::Closure& closure); |
69 | 69 |
70 // Returns the shared memory handle of the gamepad data duplicated into the | 70 // Returns a duplicate of the shared memory handle of the gamepad data. |
71 // given process. | 71 base::SharedMemoryHandle DuplicateSharedMemoryHandle(); |
72 base::SharedMemoryHandle GetSharedMemoryHandleForProcess( | |
73 base::ProcessHandle handle); | |
74 | 72 |
75 // Returns a new mojo::ScopedSharedBuffer handle of the gamepad data. | 73 // Returns a new mojo::ScopedSharedBuffer handle of the gamepad data. |
76 mojo::ScopedSharedBufferHandle GetSharedBufferHandle(); | 74 mojo::ScopedSharedBufferHandle GetSharedBufferHandle(); |
77 | 75 |
78 // Stop/join with the background thread in GamepadProvider |provider_|. | 76 // Stop/join with the background thread in GamepadProvider |provider_|. |
79 void Terminate(); | 77 void Terminate(); |
80 | 78 |
81 // Called on IO thread when a gamepad is connected. | 79 // Called on IO thread when a gamepad is connected. |
82 void OnGamepadConnected(int index, const Gamepad& pad); | 80 void OnGamepadConnected(int index, const Gamepad& pad); |
83 | 81 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 int num_active_consumers_; | 128 int num_active_consumers_; |
131 | 129 |
132 bool gesture_callback_pending_; | 130 bool gesture_callback_pending_; |
133 | 131 |
134 DISALLOW_COPY_AND_ASSIGN(GamepadService); | 132 DISALLOW_COPY_AND_ASSIGN(GamepadService); |
135 }; | 133 }; |
136 | 134 |
137 } // namespace content | 135 } // namespace content |
138 | 136 |
139 #endif // DEVICE_GAMEPAD_GAMEPAD_SERVICE_H_ | 137 #endif // DEVICE_GAMEPAD_GAMEPAD_SERVICE_H_ |
OLD | NEW |