OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/test_runner/gamepad_controller.h" | 5 #include "components/test_runner/gamepad_controller.h" |
6 | 6 |
| 7 #include <string.h> |
| 8 |
| 9 #include "base/macros.h" |
7 #include "components/test_runner/web_test_delegate.h" | 10 #include "components/test_runner/web_test_delegate.h" |
8 #include "gin/arguments.h" | 11 #include "gin/arguments.h" |
9 #include "gin/handle.h" | 12 #include "gin/handle.h" |
10 #include "gin/object_template_builder.h" | 13 #include "gin/object_template_builder.h" |
11 #include "gin/wrappable.h" | 14 #include "gin/wrappable.h" |
12 #include "third_party/WebKit/public/platform/WebGamepadListener.h" | 15 #include "third_party/WebKit/public/platform/WebGamepadListener.h" |
13 #include "third_party/WebKit/public/web/WebFrame.h" | 16 #include "third_party/WebKit/public/web/WebFrame.h" |
14 #include "third_party/WebKit/public/web/WebKit.h" | 17 #include "third_party/WebKit/public/web/WebKit.h" |
15 #include "v8/include/v8.h" | 18 #include "v8/include/v8.h" |
16 | 19 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 244 |
242 void GamepadController::SetAxisData(int index, int axis, double data) { | 245 void GamepadController::SetAxisData(int index, int axis, double data) { |
243 if (index < 0 || index >= static_cast<int>(WebGamepads::itemsLengthCap)) | 246 if (index < 0 || index >= static_cast<int>(WebGamepads::itemsLengthCap)) |
244 return; | 247 return; |
245 if (axis < 0 || axis >= static_cast<int>(WebGamepad::axesLengthCap)) | 248 if (axis < 0 || axis >= static_cast<int>(WebGamepad::axesLengthCap)) |
246 return; | 249 return; |
247 gamepads_.items[index].axes[axis] = data; | 250 gamepads_.items[index].axes[axis] = data; |
248 } | 251 } |
249 | 252 |
250 } // namespace test_runner | 253 } // namespace test_runner |
OLD | NEW |