Restrict Device{Orientation|Motion}Events to secure origins.

Registering event handlers to `devicemotion`, `deviceorientation`,
and `deviceorientationabsolute` events is still possible, but the
handlers will never be invoked in non-secure browsing contexts.

The following, related, interfaces are marked as [SecureContext]:
  -- DeviceOrientationEvent,
  -- DeviceMotionEvent,
  -- DeviceMotionEventAcceleration,
  -- DeviceMotionEventRotationRate.

The change is gated on RestrictDeviceSensorEventsToSecureContexts,
which is disabled by default, so this CL is a no-op unless the
base::Feature with the same name is manually enabled.

Intent to remove:!topic/blink-dev/5yqfAXibz1I

Bug: 932078
Change-Id: I9baaafd1f4483f121feadc054650c4d510a2c88d
Commit-Queue: Balazs Engedy <>
Reviewed-by: Reilly Grant <>
Cr-Commit-Position: refs/heads/master@{#634620}
29 files changed