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 #include "content/browser/gamepad/gamepad_service.h" | 5 #include "content/browser/gamepad/gamepad_service.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 it->consumer->OnGamepadDisconnected(index, pad); | 146 it->consumer->OnGamepadDisconnected(index, pad); |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
150 base::SharedMemoryHandle GamepadService::GetSharedMemoryHandleForProcess( | 150 base::SharedMemoryHandle GamepadService::GetSharedMemoryHandleForProcess( |
151 base::ProcessHandle handle) { | 151 base::ProcessHandle handle) { |
152 DCHECK(thread_checker_.CalledOnValidThread()); | 152 DCHECK(thread_checker_.CalledOnValidThread()); |
153 return provider_->GetSharedMemoryHandleForProcess(handle); | 153 return provider_->GetSharedMemoryHandleForProcess(handle); |
154 } | 154 } |
155 | 155 |
| 156 base::SharedMemoryHandle GamepadService::GetSharedMemoryHandle() { |
| 157 DCHECK(thread_checker_.CalledOnValidThread()); |
| 158 return provider_->GetSharedMemoryHandle(); |
| 159 } |
| 160 |
156 void GamepadService::OnUserGesture() { | 161 void GamepadService::OnUserGesture() { |
157 DCHECK(thread_checker_.CalledOnValidThread()); | 162 DCHECK(thread_checker_.CalledOnValidThread()); |
158 | 163 |
159 gesture_callback_pending_ = false; | 164 gesture_callback_pending_ = false; |
160 | 165 |
161 if (!provider_ || | 166 if (!provider_ || |
162 num_active_consumers_ == 0) | 167 num_active_consumers_ == 0) |
163 return; | 168 return; |
164 | 169 |
165 for (ConsumerSet::iterator it = consumers_.begin(); | 170 for (ConsumerSet::iterator it = consumers_.begin(); |
(...skipping 10 matching lines...) Expand all Loading... |
176 } | 181 } |
177 } | 182 } |
178 } | 183 } |
179 } | 184 } |
180 | 185 |
181 void GamepadService::SetSanitizationEnabled(bool sanitize) { | 186 void GamepadService::SetSanitizationEnabled(bool sanitize) { |
182 provider_->SetSanitizationEnabled(sanitize); | 187 provider_->SetSanitizationEnabled(sanitize); |
183 } | 188 } |
184 | 189 |
185 } // namespace content | 190 } // namespace content |
OLD | NEW |