Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(769)

Side by Side Diff: third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp

Issue 2352713004: Added displayId to Gamepad (Closed)
Patch Set: Re-upstream w/o webvr dependency Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 29 matching lines...) Expand all
40 { 40 {
41 gamepad.setId(webGamepad.id); 41 gamepad.setId(webGamepad.id);
42 gamepad.setIndex(index); 42 gamepad.setIndex(index);
43 gamepad.setConnected(webGamepad.connected); 43 gamepad.setConnected(webGamepad.connected);
44 gamepad.setTimestamp(webGamepad.timestamp); 44 gamepad.setTimestamp(webGamepad.timestamp);
45 gamepad.setMapping(webGamepad.mapping); 45 gamepad.setMapping(webGamepad.mapping);
46 gamepad.setAxes(webGamepad.axesLength, webGamepad.axes); 46 gamepad.setAxes(webGamepad.axesLength, webGamepad.axes);
47 gamepad.setButtons(webGamepad.buttonsLength, webGamepad.buttons); 47 gamepad.setButtons(webGamepad.buttonsLength, webGamepad.buttons);
48 gamepad.setPose(webGamepad.pose); 48 gamepad.setPose(webGamepad.pose);
49 gamepad.setHand(webGamepad.hand); 49 gamepad.setHand(webGamepad.hand);
50 gamepad.setDisplayId(webGamepad.displayId);
50 } 51 }
51 52
52 template<typename GamepadType, typename ListType> 53 template<typename GamepadType, typename ListType>
53 static void sampleGamepads(ListType* into) 54 static void sampleGamepads(ListType* into)
54 { 55 {
55 WebGamepads gamepads; 56 WebGamepads gamepads;
56 57
57 GamepadDispatcher::instance().sampleGamepads(gamepads); 58 GamepadDispatcher::instance().sampleGamepads(gamepads);
58 59
59 for (unsigned i = 0; i < WebGamepads::itemsLengthCap; ++i) { 60 for (unsigned i = 0; i < WebGamepads::itemsLengthCap; ++i) {
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { 276 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) {
276 m_pendingEvents.append(newGamepad); 277 m_pendingEvents.append(newGamepad);
277 } 278 }
278 } 279 }
279 280
280 if (!m_pendingEvents.isEmpty()) 281 if (!m_pendingEvents.isEmpty())
281 m_dispatchOneEventRunner->runAsync(); 282 m_dispatchOneEventRunner->runAsync();
282 } 283 }
283 284
284 } // namespace blink 285 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/gamepad/Gamepad.idl ('k') | third_party/WebKit/public/platform/WebGamepad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698