New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 9 users
Status: Fixed
Owner:
Closed: Nov 2015
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment
Update Gamepad API to match latest spec
Project Member Reported by bajones@chromium.org, Feb 18 2014 Back to list
The latest draft of the gamepad spec (https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html) includes an updated button structure, a "mapping" attribute to indicate standard gamepad mappings, a "connected" boolean, and gamepad connected and disconnected events. Firefox exposes gamepads with this newer structure and it would be great to bring Chrome's implementation up to speed as well to ease the burden of developing cross-browser input handling.
 
Project Member Comment 1 by bugdroid1@chromium.org, Feb 20 2014
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=167539

------------------------------------------------------------------------
r167539 | bajones@chromium.org | 2014-02-20T21:49:54.559509Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.h?r1=167539&r2=167538&pathrev=167539
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.idl?r1=167539&r2=167538&pathrev=167539
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/modules.gypi?r1=167539&r2=167538&pathrev=167539
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepads.h?r1=167539&r2=167538&pathrev=167539
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.h?r1=167539&r2=167538&pathrev=167539
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.idl?r1=167539&r2=167538&pathrev=167539
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/NavigatorGamepad.cpp?r1=167539&r2=167538&pathrev=167539
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.cpp?r1=167539&r2=167538&pathrev=167539
   M http://src.chromium.org/viewvc/blink/trunk/Source/build/features.gypi?r1=167539&r2=167538&pathrev=167539
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepad.h?r1=167539&r2=167538&pathrev=167539
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.cpp?r1=167539&r2=167538&pathrev=167539

Updating Blink-side Gamepad API to match latest spec

BUG=344556
R=abarth@chromium.org, scottmg@chromium.org

Review URL: https://codereview.chromium.org/170993002
------------------------------------------------------------------------
Project Member Comment 2 by bugdroid1@chromium.org, Feb 20 2014
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=167541

------------------------------------------------------------------------
r167541 | bajones@chromium.org | 2014-02-20T22:18:23.836487Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/NavigatorGamepad.cpp?r1=167541&r2=167540&pathrev=167541
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.cpp?r1=167541&r2=167540&pathrev=167541
   M http://src.chromium.org/viewvc/blink/trunk/Source/build/features.gypi?r1=167541&r2=167540&pathrev=167541
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepad.h?r1=167541&r2=167540&pathrev=167541
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.cpp?r1=167541&r2=167540&pathrev=167541
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.h?r1=167541&r2=167540&pathrev=167541
   D http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.idl?r1=167541&r2=167540&pathrev=167541
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/modules.gypi?r1=167541&r2=167540&pathrev=167541
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepads.h?r1=167541&r2=167540&pathrev=167541
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.h?r1=167541&r2=167540&pathrev=167541
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.idl?r1=167541&r2=167540&pathrev=167541

Revert 167539 "Updating Blink-side Gamepad API to match latest spec"

Compiler errors introduced on Blink waterfall

> Updating Blink-side Gamepad API to match latest spec
> 
> BUG=344556
> R=abarth@chromium.org, scottmg@chromium.org
> 
> Review URL: https://codereview.chromium.org/170993002

TBR=bajones@chromium.org

Review URL: https://codereview.chromium.org/171423019
------------------------------------------------------------------------
Project Member Comment 3 by bugdroid1@chromium.org, Feb 20 2014
The following revision refers to this bug:
    http://src.chromium.org/viewvc/blink?view=rev&rev=167548

------------------------------------------------------------------------
r167548 | bajones@chromium.org | 2014-02-20T23:11:04.357076Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.h?r1=167548&r2=167547&pathrev=167548
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.idl?r1=167548&r2=167547&pathrev=167548
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/NavigatorGamepad.cpp?r1=167548&r2=167547&pathrev=167548
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepad.h?r1=167548&r2=167547&pathrev=167548
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.cpp?r1=167548&r2=167547&pathrev=167548
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepads.h?r1=167548&r2=167547&pathrev=167548

Updating Blink-side Gamepad API to match latest spec

BUG=344556
R=abarth@chromium.org, scottmg@chromium.org

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=167539

Review URL: https://codereview.chromium.org/170993002
------------------------------------------------------------------------
Nice progress. Do you also plan to implement the connected/disconnected events?
Status: Started
Yup, they're on the TODO list.
Project Member Comment 6 by bugdroid1@chromium.org, Feb 26 2014
------------------------------------------------------------------------
r253623 | bajones@chromium.org | 2014-02-26T23:28:28.548282Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_standard_mappings_win.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/shared_impl/ppb_gamepad_shared.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_standard_mappings_linux.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/shared_impl/ppb_gamepad_shared.h?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_platform_data_fetcher_mac.mm?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/common/gamepad_user_gesture.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/test_runner/gamepad_controller.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_provider_unittest.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_platform_data_fetcher_win.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_platform_data_fetcher_linux.cc?r1=253623&r2=253622&pathrev=253623
   A http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_standard_mappings.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_standard_mappings.h?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/content_browser.gypi?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_standard_mappings_mac.mm?r1=253623&r2=253622&pathrev=253623

Updating Gamepad API to match latest spec

BUG=344556

Review URL: https://codereview.chromium.org/165983005
------------------------------------------------------------------------
Project Member Comment 7 by bugdroid1@chromium.org, Feb 26 2014
------------------------------------------------------------------------
r253623 | bajones@chromium.org | 2014-02-26T23:28:28.548282Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_standard_mappings_win.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/shared_impl/ppb_gamepad_shared.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_standard_mappings_linux.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/shared_impl/ppb_gamepad_shared.h?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_platform_data_fetcher_mac.mm?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/common/gamepad_user_gesture.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/test_runner/gamepad_controller.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_provider_unittest.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_platform_data_fetcher_win.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_platform_data_fetcher_linux.cc?r1=253623&r2=253622&pathrev=253623
   A http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_standard_mappings.cc?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_standard_mappings.h?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/content_browser.gypi?r1=253623&r2=253622&pathrev=253623
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_standard_mappings_mac.mm?r1=253623&r2=253622&pathrev=253623

Updating Gamepad API to match latest spec

BUG=344556

Review URL: https://codereview.chromium.org/165983005
------------------------------------------------------------------------
Project Member Comment 8 by bugdroid1@chromium.org, Mar 13 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=169148

------------------------------------------------------------------
r169148 | bajones@chromium.org | 2014-03-13T21:45:17.841945Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/frame/UseCounter.h?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/NavigatorGamepad.h?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-api.html?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadList.idl?r1=169148&r2=169147&pathrev=169148
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.idl?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-polling-access-expected.txt?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.idl?r1=169148&r2=169147&pathrev=169148
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/WebKitGamepadList.idl?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-api-expected.txt?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadList.cpp?r1=169148&r2=169147&pathrev=169148
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.cpp?r1=169148&r2=169147&pathrev=169148
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/WebKitGamepad.idl?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.cpp?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/NavigatorGamepad.idl?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadList.h?r1=169148&r2=169147&pathrev=169148
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.h?r1=169148&r2=169147&pathrev=169148
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/WebKitGamepadList.cpp?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/modules.gypi?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.h?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/fast/dom/navigator-detached-no-crash-expected.txt?r1=169148&r2=169147&pathrev=169148
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/WebKitGamepad.cpp?r1=169148&r2=169147&pathrev=169148
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/WebKitGamepadList.h?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/virtual/stable/webexposed/global-constructors-listing-expected.txt?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-constructors-listing-expected.txt?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/frame/UseCounter.cpp?r1=169148&r2=169147&pathrev=169148
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/WebKitGamepad.h?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/NavigatorGamepad.cpp?r1=169148&r2=169147&pathrev=169148
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-polling-access.html?r1=169148&r2=169147&pathrev=169148

Added non-prefixed navigator.getGamepads() with updated API

This CL splits the Gamepad API into prefixed and non-prefixed versions.
The prefixed version continues to operate in the same way as before, though
the types are now named WebKitGamepad and WebKitGamepadList. The non-prefixed
version uses the new GamepadButton type for its button values.

The GamepadEvent type has also been added but the events aren't yet wired up.
When added they will only apply to the the non-prefixed API.

BUG=344556

Review URL: https://codereview.chromium.org/183313003
-----------------------------------------------------------------
Project Member Comment 9 by bugdroid1@chromium.org, Mar 14 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=169194

------------------------------------------------------------------
r169194 | nbarth@chromium.org | 2014-03-14T02:33:30.848288Z

Changed paths:
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadCommon.h?r1=169194&r2=169193&pathrev=169194
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.cpp?r1=169194&r2=169193&pathrev=169194
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadList.h?r1=169194&r2=169193&pathrev=169194
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/WebKitGamepadList.cpp?r1=169194&r2=169193&pathrev=169194
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/modules.gypi?r1=169194&r2=169193&pathrev=169194
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.h?r1=169194&r2=169193&pathrev=169194
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/WebKitGamepad.cpp?r1=169194&r2=169193&pathrev=169194
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/WebKitGamepadList.h?r1=169194&r2=169193&pathrev=169194
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadCommon.cpp?r1=169194&r2=169193&pathrev=169194
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/WebKitGamepad.h?r1=169194&r2=169193&pathrev=169194
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadList.cpp?r1=169194&r2=169193&pathrev=169194

Factor out GamepadCommon base class from Gamepad and WebKitGamepad

WebKitGamepad is a legacy interface for Gamepad, and hence there's a lot of duplicated code.
This reduces the duplication by C++ inheritance from a base class.

(Also cleanup for consistency and brevity.)

There isn't much code duplication for WebKitGamepadList/GamepadList,
so no benefit for a base class there, but tweaks.

Notes:
* Use C++ inheritance only; IDL files are unchanged
(*implementation* is inherited, *interface* is not)

* Inherit from an abstract GamepadCommon class
(needed for ScriptWrappable::init in constructor, avoids duplicate members and virtual methods)

Followup to:
Added non-prefixed navigator.getGamepads() with updated API
https://codereview.chromium.org/183313003/

BUG=344556

Review URL: https://codereview.chromium.org/195993007
-----------------------------------------------------------------
Work is in progress on the connection events: https://codereview.chromium.org/200783002/; https://codereview.chromium.org/200873002/
Project Member Comment 11 by bugdroid1@chromium.org, Mar 17 2014
------------------------------------------------------------------
r257454 | bajones@chromium.org | 2014-03-17T16:56:54.703015Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=257454&r2=257453&pathrev=257454

Removing Chrome Gamepad transition cruft

BUG=344556
TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/202043003
-----------------------------------------------------------------
Project Member Comment 12 by bugdroid1@chromium.org, Mar 17 2014
------------------------------------------------------------------
r257460 | bajones@chromium.org | 2014-03-17T17:18:53.305026Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=257460&r2=257459&pathrev=257460

Revert of Removing Chrome Gamepad transition cruft (https://codereview.chromium.org/202043003/)

Reason for revert:
Forgot to roll WebKit deps.

Original issue's description:
> Removing Chrome Gamepad transition cruft
> 
> BUG=344556
> TBR=eseidel@chromium.org
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=257454

TBR=eseidel@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=344556

Review URL: https://codereview.chromium.org/202123003
-----------------------------------------------------------------
Project Member Comment 13 by bugdroid1@chromium.org, Mar 18 2014
------------------------------------------------------------------
r257694 | bajones@chromium.org | 2014-03-18T18:09:23.139546Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=257694&r2=257693&pathrev=257694

Removing Chrome Gamepad transition cruft (Take 2)

"Don't break the build this time" edition.

BUG=344556
TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/202513002
-----------------------------------------------------------------
Project Member Comment 14 by bugdroid1@chromium.org, Mar 20 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=169363

------------------------------------------------------------------
r169363 | bajones@chromium.org | 2014-03-17T16:53:12.074666Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepad.h?r1=169363&r2=169362&pathrev=169363
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepads.h?r1=169363&r2=169362&pathrev=169363

Removed Blink Gamepad transition cruft

BUG=344556
TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/196833003
-----------------------------------------------------------------
Project Member Comment 15 by bugdroid1@chromium.org, Mar 21 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=169716

------------------------------------------------------------------
r169716 | b.kelemen@samsung.com | 2014-03-21T02:57:50.057101Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/virtual/stable/webexposed/global-constructors-listing-expected.txt?r1=169716&r2=169715&pathrev=169716
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/webexposed/global-constructors-listing-expected.txt?r1=169716&r2=169715&pathrev=169716
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/NavigatorGamepad.cpp?r1=169716&r2=169715&pathrev=169716
   M http://src.chromium.org/viewvc/blink/trunk/Source/web/FrameLoaderClientImpl.cpp?r1=169716&r2=169715&pathrev=169716
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadDispatcher.h?r1=169716&r2=169715&pathrev=169716
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/NavigatorGamepad.h?r1=169716&r2=169715&pathrev=169716
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepads.h?r1=169716&r2=169715&pathrev=169716
   M http://src.chromium.org/viewvc/blink/trunk/Source/core/events/EventTypeNames.in?r1=169716&r2=169715&pathrev=169716
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/Platform.h?r1=169716&r2=169715&pathrev=169716
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadEvent.idl?r1=169716&r2=169715&pathrev=169716
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/Dictionary.cpp?r1=169716&r2=169715&pathrev=169716
   M http://src.chromium.org/viewvc/blink/trunk/Source/bindings/v8/Dictionary.h?r1=169716&r2=169715&pathrev=169716
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/modules.gypi?r1=169716&r2=169715&pathrev=169716
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadEvent.cpp?r1=169716&r2=169715&pathrev=169716
   A http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepadListener.h?r1=169716&r2=169715&pathrev=169716
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadEvent.h?r1=169716&r2=169715&pathrev=169716
   A http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadDispatcher.cpp?r1=169716&r2=169715&pathrev=169716

Gamepad API: add support for gamepadconnected and gamepaddisconnected events

Co-authored with Brandon Jones.

This CL continues the work of updating the Gamepad API to latest spec. NavigatorGamepad implements
WebGamepadListener which is the interface chromium will talk to when dispatching gamepad events.
The implementation follows the dispatcher-controller pattern used by device motion and device orientation.
There is some difference though because the gamepad data is polled instead of pushed by the platform.

BUG=344556

Review URL: https://codereview.chromium.org/200783002
-----------------------------------------------------------------
Project Member Comment 16 by bugdroid1@chromium.org, Mar 25 2014
------------------------------------------------------------------
r259102 | b.kelemen@samsung.com | 2014-03-25T02:20:01.250394Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/webkit_test_runner.h?r1=259102&r2=259101&pathrev=259102
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/test_runner/WebTestDelegate.h?r1=259102&r2=259101&pathrev=259102
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/renderer_webkitplatformsupport_impl.cc?r1=259102&r2=259101&pathrev=259102
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/renderer_webkitplatformsupport_impl.h?r1=259102&r2=259101&pathrev=259102
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/test_runner/gamepad_controller.cc?r1=259102&r2=259101&pathrev=259102
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/test/layouttest_support.h?r1=259102&r2=259101&pathrev=259102
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/test_runner/gamepad_controller.h?r1=259102&r2=259101&pathrev=259102
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/test/layouttest_support.cc?r1=259102&r2=259101&pathrev=259102
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/webkit_test_runner.cc?r1=259102&r2=259101&pathrev=259102

Gamepad API: add test support for gamepad events

This CL adds layout test support for 'gamepadconnected' and 'gamepaddidconnected' events.

BUG=344556

Review URL: https://codereview.chromium.org/207323002
-----------------------------------------------------------------
Project Member Comment 17 by bugdroid1@chromium.org, Mar 31 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=170461

------------------------------------------------------------------
r170461 | b.kelemen@samsung.com | 2014-03-31T16:39:55.006975Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-api.html?r1=170461&r2=170460&pathrev=170461
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-events-basic-expected.txt?r1=170461&r2=170460&pathrev=170461
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-api-expected.txt?r1=170461&r2=170460&pathrev=170461
   A http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-events-basic.html?r1=170461&r2=170460&pathrev=170461

Gamepad API: tests for gamepad events

This CL adds a basic test for 'gamepadconnected' and 'gamepaddisconnected' events and extends the api test to check the differences between the prefixed and non-prefixed api's.

BUG=344556

Review URL: https://codereview.chromium.org/212813008
-----------------------------------------------------------------
Project Member Comment 18 by bugdroid1@chromium.org, May 9 2014
------------------------------------------------------------------
r269189 | b.kelemen@samsung.com | 2014-05-09T09:09:47.483924Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_provider.cc?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/pepper/pepper_gamepad_host.h?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/DEPS?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_provider.h?r1=269189&r2=269188&pathrev=269189
   A http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_consumer.h?r1=269189&r2=269188&pathrev=269189
   A http://src.chromium.org/viewvc/chrome/trunk/src/content/common/gamepad_param_traits.cc?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/render_thread_impl.cc?r1=269189&r2=269188&pathrev=269189
   A http://src.chromium.org/viewvc/chrome/trunk/src/content/common/gamepad_param_traits.h?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/render_thread_impl.h?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_service.cc?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/common/DEPS?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/gamepad_browser_message_filter.cc?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/content_browser.gypi?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_service.h?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/gamepad_browser_message_filter.h?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/gamepad_shared_memory_reader.cc?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/renderer_webkitplatformsupport_impl.cc?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/content_common.gypi?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/gamepad_shared_memory_reader.h?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/common/gamepad_messages.h?r1=269189&r2=269188&pathrev=269189
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/pepper/pepper_gamepad_host.cc?r1=269189&r2=269188&pathrev=269189

Gamepad API: add support for connection events

Co-authored with Brandon Jones.

This CL continues the work of updating the Gamepad API to latest spec.
IPC's added for connected and disconnected events. The connection state
is observed by GamepadProvider together with polling. The other option
would be to add logic to each platform fetcher. Doing it in GamepadProvider
avoids duplicated logic and I think it is a bit simpler and more consistent
with the polling base nature of the gamepad implementation.

Extra care has been taken to make it consistent with the policy of not
exposing gamepad data to the page before a user gesture is observed.
When a new page starts listening it will not get any events until
we see a user gesture. When we see it we notify it about all the connected
pads.

Now we stop polling as soon as blink is no more interested in gamepad data.

BUG=344556

Review URL: https://codereview.chromium.org/195873019
-----------------------------------------------------------------
Project Member Comment 19 by bugdroid1@chromium.org, May 9 2014
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0ff7365690e19be1f20fe83ab9001205989ae13f

commit 0ff7365690e19be1f20fe83ab9001205989ae13f
Author: b.kelemen@samsung.com <b.kelemen@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Fri May 09 09:09:47 2014

Gamepad API: add support for connection events

Co-authored with Brandon Jones.

This CL continues the work of updating the Gamepad API to latest spec.
IPC's added for connected and disconnected events. The connection state
is observed by GamepadProvider together with polling. The other option
would be to add logic to each platform fetcher. Doing it in GamepadProvider
avoids duplicated logic and I think it is a bit simpler and more consistent
with the polling base nature of the gamepad implementation.

Extra care has been taken to make it consistent with the policy of not
exposing gamepad data to the page before a user gesture is observed.
When a new page starts listening it will not get any events until
we see a user gesture. When we see it we notify it about all the connected
pads.

Now we stop polling as soon as blink is no more interested in gamepad data.

BUG=344556

Review URL: https://codereview.chromium.org/195873019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269189 0039d316-1c4b-4281-b951-d872f2087c98


Status: Fixed
Extremely happy that, after a positively heroic effort from Samsung's Balazs Kelemen to get Gamepad connection events working, this feature can now be considered complete!

Yay!
Project Member Comment 21 by bugdroid1@chromium.org, May 20 2014
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7106f336692b065c4cae6f03c527ea0df094d5c8

commit 7106f336692b065c4cae6f03c527ea0df094d5c8
Author: ch.dumez@samsung.com <ch.dumez@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Tue May 20 22:04:06 2014

Update Gamepad API to match the latest specification

Update Gamepad API to match the latest specification:
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-Gamepad-axes
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-GamepadButton-value

Namely, Gamepad.axes / GamepadButton.value should be of type double, not float.

R=bbudge@chromium.org, jam@chromium.org, scottmg@chromium.org
BUG=344556

Review URL: https://codereview.chromium.org/280713004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271775 0039d316-1c4b-4281-b951-d872f2087c98


Project Member Comment 22 by bugdroid1@chromium.org, May 20 2014
------------------------------------------------------------------
r271775 | ch.dumez@samsung.com | 2014-05-20T22:04:06.596449Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/shared_impl/ppb_gamepad_shared.cc?r1=271775&r2=271774&pathrev=271775
   M http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/shared_impl/ppb_gamepad_shared.h?r1=271775&r2=271774&pathrev=271775

Update Gamepad API to match the latest specification

Update Gamepad API to match the latest specification:
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-Gamepad-axes
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-GamepadButton-value

Namely, Gamepad.axes / GamepadButton.value should be of type double, not float.

R=bbudge@chromium.org, jam@chromium.org, scottmg@chromium.org
BUG=344556

Review URL: https://codereview.chromium.org/280713004
-----------------------------------------------------------------
Project Member Comment 23 by bugdroid1@chromium.org, May 20 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=174428

------------------------------------------------------------------
r174428 | ch.dumez@samsung.com | 2014-05-20T23:43:45.797799Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.idl?r1=174428&r2=174427&pathrev=174428
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepads.h?r1=174428&r2=174427&pathrev=174428
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-events-basic-expected.txt?r1=174428&r2=174427&pathrev=174428
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.idl?r1=174428&r2=174427&pathrev=174428
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadCommon.cpp?r1=174428&r2=174427&pathrev=174428
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-events-basic.html?r1=174428&r2=174427&pathrev=174428
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.cpp?r1=174428&r2=174427&pathrev=174428
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadCommon.h?r1=174428&r2=174427&pathrev=174428
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepad.h?r1=174428&r2=174427&pathrev=174428
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.h?r1=174428&r2=174427&pathrev=174428

Update Gamepad.axes / GamepadButton.value to match the latest specification

Update Gamepad.axes / GamepadButton.value to match the latest specification:
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-Gamepad-axes
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-GamepadButton-value

Those attributes should be of type double as per the specification but Blink
was still using float type as in older version of the specification. This can
lead to precision problem on JavaScript side.

This CL introduces temporary ENABLE_NEW_GAMEPAD_API #ifdefs to help with the
transition. Those will be removed once the Chromium side has been updated.

R=eseidel@chromium.org, bajones@chromium.org
BUG=344556
TEST=gamepad/gamepad-events-basic.html

Review URL: https://codereview.chromium.org/280393004
-----------------------------------------------------------------
Comment 24 by kbr@chromium.org, May 21 2014
Status: Started
http://src.chromium.org/viewvc/blink?view=revision&revision=174428 broke the Windows Debug build:

http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win%20Builder%20%28dbg%29/builds/50258

Reverting.

Comment 25 by kbr@chromium.org, May 21 2014
FYI here's the log excerpt from the failing build in case it expires:

FAILED: ninja -t msvc -e environment.x86 -- "C:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\content\renderer\pepper\content.pepper_plugin_instance_impl.obj.rsp /c ..\..\content\renderer\pepper\pepper_plugin_instance_impl.cc /Foobj\content\renderer\pepper\content.pepper_plugin_instance_impl.obj /Fdobj\content\content.cc.pdb 
c:\b\build\slave\webkit-win-latest-dbg\build\src\base\macros.h(270) : error C2118: negative subscript
        c:\b\build\slave\webkit-win-latest-dbg\build\src\content\renderer\pepper\pepper_plugin_instance_impl.cc(483) : see reference to function template instantiation 'Dest bit_cast<ppapi::WebKitGamepads,blink::WebGamepads>(const Source &)' being compiled
        with
        [
            Dest=ppapi::WebKitGamepads
,            Source=blink::WebGamepads
        ]


Project Member Comment 26 by bugdroid1@chromium.org, May 21 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=174433

------------------------------------------------------------------
r174433 | kbr@chromium.org | 2014-05-21T00:32:25.726691Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-events-basic.html?r1=174433&r2=174432&pathrev=174433
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.cpp?r1=174433&r2=174432&pathrev=174433
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadCommon.h?r1=174433&r2=174432&pathrev=174433
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepad.h?r1=174433&r2=174432&pathrev=174433
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.h?r1=174433&r2=174432&pathrev=174433
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.idl?r1=174433&r2=174432&pathrev=174433
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepads.h?r1=174433&r2=174432&pathrev=174433
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-events-basic-expected.txt?r1=174433&r2=174432&pathrev=174433
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.idl?r1=174433&r2=174432&pathrev=174433
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadCommon.cpp?r1=174433&r2=174432&pathrev=174433

Revert 174428 "Update Gamepad.axes / GamepadButton.value to matc..."

Broke Windows Debug build. See Issue 344556 for details.

> Update Gamepad.axes / GamepadButton.value to match the latest specification
> 
> Update Gamepad.axes / GamepadButton.value to match the latest specification:
> https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-Gamepad-axes
> https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-GamepadButton-value
> 
> Those attributes should be of type double as per the specification but Blink
> was still using float type as in older version of the specification. This can
> lead to precision problem on JavaScript side.
> 
> This CL introduces temporary ENABLE_NEW_GAMEPAD_API #ifdefs to help with the
> transition. Those will be removed once the Chromium side has been updated.
> 
> R=eseidel@chromium.org, bajones@chromium.org
> BUG=344556
> TEST=gamepad/gamepad-events-basic.html
> 
> Review URL: https://codereview.chromium.org/280393004

TBR=ch.dumez@samsung.com

Review URL: https://codereview.chromium.org/296723005
-----------------------------------------------------------------
Project Member Comment 27 by bugdroid1@chromium.org, May 22 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=174544

------------------------------------------------------------------
r174544 | ch.dumez@samsung.com | 2014-05-22T11:20:31.446688Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-events-basic.html?r1=174544&r2=174543&pathrev=174544
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.cpp?r1=174544&r2=174543&pathrev=174544
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadCommon.h?r1=174544&r2=174543&pathrev=174544
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepad.h?r1=174544&r2=174543&pathrev=174544
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/TestExpectations?r1=174544&r2=174543&pathrev=174544
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.h?r1=174544&r2=174543&pathrev=174544
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadButton.idl?r1=174544&r2=174543&pathrev=174544
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepads.h?r1=174544&r2=174543&pathrev=174544
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/gamepad/gamepad-events-basic-expected.txt?r1=174544&r2=174543&pathrev=174544
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/Gamepad.idl?r1=174544&r2=174543&pathrev=174544
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadCommon.cpp?r1=174544&r2=174543&pathrev=174544

Update Gamepad.axes / GamepadButton.value to match the latest specification

Update Gamepad.axes / GamepadButton.value to match the latest specification:
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-Gamepad-axes
https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#widl-GamepadButton-value

Those attributes should be of type double as per the specification but Blink
was still using float type as in older version of the specification. This can
lead to precision problem on JavaScript side.

This CL introduces temporary ENABLE_NEW_GAMEPAD_API #ifdefs to help with the
transition. Those will be removed once the Chromium side has been updated.

R=eseidel@chromium.org, bajones@chromium.org
BUG=344556
TEST=gamepad/gamepad-events-basic.html

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=174428

Review URL: https://codereview.chromium.org/280393004
-----------------------------------------------------------------
Project Member Comment 28 by bugdroid1@chromium.org, May 24 2014
------------------------------------------------------------------
r272723 | ch.dumez@samsung.com | 2014-05-24T12:47:00.762160Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/ppapi/shared_impl/ppb_gamepad_shared.h?r1=272723&r2=272722&pathrev=272723
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=272723&r2=272722&pathrev=272723

Turn on ENABLE_NEW_GAMEPAD_API flag so that the new gamepad code is used

Turn on ENABLE_NEW_GAMEPAD_API flag so that the new gamepad code is used.
Also remove the old code on Chromium side. The ENABLE_NEW_GAMEPAD_API is only
needed until the Blink side #ifdefs are removed.

BUG=344556

Review URL: https://codereview.chromium.org/289423004
-----------------------------------------------------------------
Project Member Comment 29 by bugdroid1@chromium.org, May 27 2014
The following revision refers to this bug:
  http://src.chromium.org/viewvc/blink?view=rev&rev=174781

------------------------------------------------------------------
r174781 | ch.dumez@samsung.com | 2014-05-26T04:16:47.590343Z

Changed paths:
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadCommon.h?r1=174781&r2=174780&pathrev=174781
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepad.h?r1=174781&r2=174780&pathrev=174781
   M http://src.chromium.org/viewvc/blink/trunk/LayoutTests/TestExpectations?r1=174781&r2=174780&pathrev=174781
   M http://src.chromium.org/viewvc/blink/trunk/public/platform/WebGamepads.h?r1=174781&r2=174780&pathrev=174781
   M http://src.chromium.org/viewvc/blink/trunk/Source/modules/gamepad/GamepadCommon.cpp?r1=174781&r2=174780&pathrev=174781

Remove ENABLE_NEW_GAMEPAD_API #ifdefs

Remove ENABLE_NEW_GAMEPAD_API #ifdefs now that the chromium side has been
updated and now that the flag is turned on by default.

R=eseidel@chromium.org
BUG=344556

Review URL: https://codereview.chromium.org/302563003
-----------------------------------------------------------------
Project Member Comment 30 by bugdroid1@chromium.org, May 30 2014
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c3f049b7a9141a6834f596b58c2d04b02a287077

commit c3f049b7a9141a6834f596b58c2d04b02a287077
Author: ch.dumez@samsung.com <ch.dumez@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Fri May 30 22:49:25 2014

Drop ENABLE_NEW_GAMEPAD_API build flag as it is no longer needed

Drop ENABLE_NEW_GAMEPAD_API build flag as it is no longer needed now that
the Blink side has been updated and all the #ifdefs have been removed.

R=dmichael@chromium.org, brettw@chromium.org
BUG=344556

Review URL: https://codereview.chromium.org/302893002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273921 0039d316-1c4b-4281-b951-d872f2087c98


Project Member Comment 31 by bugdroid1@chromium.org, May 30 2014
------------------------------------------------------------------
r273921 | ch.dumez@samsung.com | 2014-05-30T22:49:25.064161Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/config/BUILD.gn?r1=273921&r2=273920&pathrev=273921
   M http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?r1=273921&r2=273920&pathrev=273921

Drop ENABLE_NEW_GAMEPAD_API build flag as it is no longer needed

Drop ENABLE_NEW_GAMEPAD_API build flag as it is no longer needed now that
the Blink side has been updated and all the #ifdefs have been removed.

R=dmichael@chromium.org, brettw@chromium.org
BUG=344556

Review URL: https://codereview.chromium.org/302893002
-----------------------------------------------------------------
Project Member Comment 32 by bugdroid1@chromium.org, Jun 20 2014
------------------------------------------------------------------
r278723 | b.kelemen@samsung.com | 2014-06-20T16:57:06.102498Z

Changed paths:
   A http://src.chromium.org/viewvc/chrome/trunk/src/content/public/renderer/renderer_gamepad_provider.h?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/gamepad_shared_memory_reader.cc?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/renderer_webkitplatformsupport_impl.cc?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/gamepad_shared_memory_reader.h?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/renderer_webkitplatformsupport_impl.h?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/test_runner/gamepad_controller.cc?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/public/test/layouttest_support.h?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/test_runner/gamepad_controller.h?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/test/layouttest_support.cc?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/webkit_test_runner.cc?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/webkit_test_runner.h?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/render_thread_impl.cc?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/renderer/render_thread_impl.h?r1=278723&r2=278722&pathrev=278723
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/test_runner/WebTestDelegate.h?r1=278723&r2=278722&pathrev=278723

Gamepad: make page visibility behavior layout testable

This CL refactors testing infrastructure for gamepad so that we can
actually write a layout test that would fail if Blink doesn't honor
visibility state. Now Platform::setGamepadListener is now hooked to
GamepadController.

BUG=344556

Review URL: https://codereview.chromium.org/304403002
-----------------------------------------------------------------
Project Member Comment 33 by bugdroid1@chromium.org, Jun 20 2014
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/078780b963c47f9b3863f14c169f779d073e6267

commit 078780b963c47f9b3863f14c169f779d073e6267
Author: b.kelemen@samsung.com <b.kelemen@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Fri Jun 20 16:57:06 2014

Gamepad: make page visibility behavior layout testable

This CL refactors testing infrastructure for gamepad so that we can
actually write a layout test that would fail if Blink doesn't honor
visibility state. Now Platform::setGamepadListener is now hooked to
GamepadController.

BUG=344556

Review URL: https://codereview.chromium.org/304403002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278723 0039d316-1c4b-4281-b951-d872f2087c98


Project Member Comment 34 by bugdroid1@chromium.org, Jun 23 2014
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/96f14d9ff4c02602891341f251d8a128ecf2c75b

commit 96f14d9ff4c02602891341f251d8a128ecf2c75b
Author: loislo@chromium.org <loislo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Mon Jun 23 10:37:49 2014

Make ASAN happy. Do not call setGamepadProvider on null pointer.

BUG=344556
TBR=bajones, jam, kbalazs

Review URL: https://codereview.chromium.org/349943002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279081 0039d316-1c4b-4281-b951-d872f2087c98


Project Member Comment 35 by bugdroid1@chromium.org, Jun 23 2014
------------------------------------------------------------------
r279081 | loislo@chromium.org | 2014-06-23T10:37:49.539284Z

Changed paths:
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/shell/renderer/test_runner/gamepad_controller.cc?r1=279081&r2=279080&pathrev=279081

Make ASAN happy. Do not call setGamepadProvider on null pointer.

BUG=344556
TBR=bajones, jam, kbalazs

Review URL: https://codereview.chromium.org/349943002
-----------------------------------------------------------------
Project Member Comment 36 by bugdroid1@chromium.org, Jul 2 2014
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aa16b184102b427f560d1c614f707b0e49e9afc4

commit aa16b184102b427f560d1c614f707b0e49e9afc4
Author: b.kelemen@samsung.com <b.kelemen@samsung.com@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Wed Jul 02 21:58:04 2014

Gamepad: don't notify about connected pads twice

Currently the first time we observe user gesture we call
GamepadConsumer::OnGamepadConnected once because of the gesture and once because of the
state change of the pad. This CL fixes that by reordering the gesture check and the
state tests in GamepadProvider the state change will be ignored by GamepadService
because did_observe_user_gesture is still false for the consumer.
Also it seems like I forget to set gesture_callback_pending_ to true when appropriate
in my former CL's, fixed it.
Added unit test for connections and made some refactoring related to unittests.

BUG=344556
R=bajones@chromium.org,scottmg@chromium.org
TBR=dmichael@chromium.org

Review URL: https://codereview.chromium.org/362123002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281098 0039d316-1c4b-4281-b951-d872f2087c98


Project Member Comment 37 by bugdroid1@chromium.org, Jul 2 2014
------------------------------------------------------------------
r281098 | b.kelemen@samsung.com | 2014-07-02T21:58:04.061754Z

Changed paths:
   A http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_service_unittest.cc?r1=281098&r2=281097&pathrev=281098
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_service.cc?r1=281098&r2=281097&pathrev=281098
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/content_tests.gypi?r1=281098&r2=281097&pathrev=281098
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_test_helpers.cc?r1=281098&r2=281097&pathrev=281098
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_service.h?r1=281098&r2=281097&pathrev=281098
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_test_helpers.h?r1=281098&r2=281097&pathrev=281098
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/renderer_host/pepper/pepper_gamepad_host_unittest.cc?r1=281098&r2=281097&pathrev=281098
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_provider_unittest.cc?r1=281098&r2=281097&pathrev=281098
   M http://src.chromium.org/viewvc/chrome/trunk/src/content/browser/gamepad/gamepad_provider.cc?r1=281098&r2=281097&pathrev=281098

Gamepad: don't notify about connected pads twice

Currently the first time we observe user gesture we call
GamepadConsumer::OnGamepadConnected once because of the gesture and once because of the
state change of the pad. This CL fixes that by reordering the gesture check and the
state tests in GamepadProvider the state change will be ignored by GamepadService
because did_observe_user_gesture is still false for the consumer.
Also it seems like I forget to set gesture_callback_pending_ to true when appropriate
in my former CL's, fixed it.
Added unit test for connections and made some refactoring related to unittests.

BUG=344556
R=bajones@chromium.org,scottmg@chromium.org
TBR=dmichael@chromium.org

Review URL: https://codereview.chromium.org/362123002
-----------------------------------------------------------------
IMHO we are ready with this. WDYT?
Comment 39 by benm@chromium.org, Nov 22 2014
Cc: benm@chromium.org
Hi folks, are there plans to support the Gamepad API on Chrome for Android?
I believe it's mostly been done, is it not working? (Or maybe it's not enabled in some builds, I'm not sure.)
It is already supported. Do you have an issue with it? What version of Chrome do you use?
Comment 42 by benm@chromium.org, Nov 22 2014
Have not tried it myself, but in conversation at the Chrome dev summit there was concern about it not supporting bluetooth gamepads on mobile. Perhaps it's the bluetooth part that is missing?

http://caniuse.com/#search=gamepad indicates that the API is not supported in Chrome for Android 38 (nor the Android WebView @m37).
Comment 43 by Deleted ...@, Nov 25 2014
Can I use also just updated to say it's not supported on Chrome for Android M39, either.
Comment 44 by phil...@opera.com, Dec 17 2014
Since this bug is still open, I'll throw in an issue:

Navigator.getGamepads() is not per spec, as it returns a GamepadList instead of an array. This can be seen in a number of ways, e.g. the object has an item function (the getter) and does not have forEach or any other niceties of Array. The length is also 4, originating from WebGamepads::itemsLengthCap. Since the same object is returned each time, navigator.getGamepads() == navigator.getGamepads().

Firefox differs in all of these specifics, being closer to what the spec says.

Here's a half-baked CL for discussion: https://codereview.chromium.org/808643005
The CL looks good overall, but we might want to wait and see what the conclusion of the discussion at https://www.w3.org/Bugs/Public/show_bug.cgi?id=26181 is before moving forward. Regardless of what's decided there, however, GamepadList does need to go so this is a good step in the right direction.
Labels: Hotlist-Recharge
This issue likely requires triage.  The current issue owner may be inactive (i.e. hasn't fixed an issue in the last 30 days or commented in this particular issue in the last 90 days).  Thanks for helping out!

-Anthony
Labels: -Hotlist-Recharge
Status: Fixed
Since the only outstanding item in this bug was waiting on Gamepad spec decisions I'm going to mark this as fixed in the interest of not leaving bugs open indefinitely.
Components: -IO>Gamepad Blink>GamepadAPI
Sign in to add a comment