OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 12 matching lines...) Expand all Loading... |
23 * DAMAGE. | 23 * DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "modules/gamepad/GamepadList.h" | 26 #include "modules/gamepad/GamepadList.h" |
27 | 27 |
28 namespace blink { | 28 namespace blink { |
29 | 29 |
30 GamepadList::GamepadList() {} | 30 GamepadList::GamepadList() {} |
31 | 31 |
32 void GamepadList::Set(unsigned index, Gamepad* gamepad) { | 32 void GamepadList::Set(unsigned index, Gamepad* gamepad) { |
33 if (index >= WebGamepads::kItemsLengthCap) | 33 if (index >= device::Gamepads::kItemsLengthCap) |
34 return; | 34 return; |
35 items_[index] = gamepad; | 35 items_[index] = gamepad; |
36 } | 36 } |
37 | 37 |
38 Gamepad* GamepadList::item(unsigned index) { | 38 Gamepad* GamepadList::item(unsigned index) { |
39 return index < length() ? items_[index].Get() : 0; | 39 return index < length() ? items_[index].Get() : 0; |
40 } | 40 } |
41 | 41 |
42 DEFINE_TRACE(GamepadList) { | 42 DEFINE_TRACE(GamepadList) { |
43 for (unsigned index = 0; index < WebGamepads::kItemsLengthCap; index++) { | 43 for (unsigned index = 0; index < device::Gamepads::kItemsLengthCap; index++) { |
44 visitor->Trace(items_[index]); | 44 visitor->Trace(items_[index]); |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 } // namespace blink | 48 } // namespace blink |
OLD | NEW |