Treat gamepad button presses as user activations

Gamepad button presses do not generate input events, which means APIs
like the Fullscreen API which require a user activation may not
function correctly when the user is interacting primarily through gamepad
inputs. This CL checks the gamepad button state each time gamepads are
polled and signals that the frame has received an activation if at
least one button is pressed.

To reduce the likelihood that inadvertent inputs may generate a user
activation, a button press is only counted if the button value is at
least 75% of the maximum value. This prevents triggers and other analog
inputs from causing user activation from a light touch. Analog axes are
not considered for user activation.

This change requires the UserActivationV2 flag to be enabled to have any
effect.

BUG=381596

Change-Id: I506ee70f39b876c81b43cb51699cba1c48a896bb
Reviewed-on: https://chromium-review.googlesource.com/1029117
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Mustaq Ahmed <mustaq@chromium.org>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556925}
6 files changed