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 <stddef.h> |
| 6 |
| 7 #include "base/macros.h" |
5 #include "content/browser/gamepad/gamepad_standard_mappings.h" | 8 #include "content/browser/gamepad/gamepad_standard_mappings.h" |
6 | 9 |
7 namespace content { | 10 namespace content { |
8 | 11 |
9 namespace { | 12 namespace { |
10 | 13 |
11 void MapperXbox360Gamepad(const blink::WebGamepad& input, | 14 void MapperXbox360Gamepad(const blink::WebGamepad& input, |
12 blink::WebGamepad* mapped) { | 15 blink::WebGamepad* mapped) { |
13 *mapped = input; | 16 *mapped = input; |
14 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[2]); | 17 mapped->buttons[BUTTON_INDEX_LEFT_TRIGGER] = AxisToButton(input.axes[2]); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 const base::StringPiece& product_id) { | 291 const base::StringPiece& product_id) { |
289 for (size_t i = 0; i < arraysize(AvailableMappings); ++i) { | 292 for (size_t i = 0; i < arraysize(AvailableMappings); ++i) { |
290 MappingData& item = AvailableMappings[i]; | 293 MappingData& item = AvailableMappings[i]; |
291 if (vendor_id == item.vendor_id && product_id == item.product_id) | 294 if (vendor_id == item.vendor_id && product_id == item.product_id) |
292 return item.function; | 295 return item.function; |
293 } | 296 } |
294 return NULL; | 297 return NULL; |
295 } | 298 } |
296 | 299 |
297 } // namespace content | 300 } // namespace content |
OLD | NEW |