| Index: third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegate.h
|
| diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegate.h b/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegate.h
|
| index af72175e54273673f43e45704eea876ce75b4910..d15659e639f310d8d274cdc72deb87727a4633eb 100644
|
| --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegate.h
|
| +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegate.h
|
| @@ -8,6 +8,7 @@
|
| #include "core/events/EventListener.h"
|
| #include "device/screen_orientation/public/interfaces/screen_orientation.mojom-blink.h"
|
| #include "modules/ModulesExport.h"
|
| +#include "platform/WebTaskRunner.h"
|
| #include "public/platform/modules/screen_orientation/WebScreenOrientationLockType.h"
|
|
|
| namespace blink {
|
| @@ -113,6 +114,11 @@ class MediaControlsOrientationLockDelegate final : public EventListener {
|
|
|
| void MaybeUnlockIfDeviceOrientationMatchesVideo(DeviceOrientationEvent*);
|
|
|
| + // Delay before unlocking - see `MaybeUnlockIfDeviceOrientationMatchesVideo`.
|
| + // Emprically, 200ms is too short, but 250ms avoids glitches. 500ms gives us
|
| + // a 2x margin in case the device is running slow, without being noticeable.
|
| + static constexpr int kUnlockDelayMs = 500;
|
| +
|
| // Current state of the object. See comment at the top of the file for a
|
| // detailed description.
|
| State state_ = State::kPendingFullscreen;
|
| @@ -121,6 +127,8 @@ class MediaControlsOrientationLockDelegate final : public EventListener {
|
| WebScreenOrientationLockType locked_orientation_ =
|
| kWebScreenOrientationLockDefault /* unlocked */;
|
|
|
| + TaskHandle unlock_task_;
|
| +
|
| device::mojom::blink::ScreenOrientationListenerPtr monitor_;
|
|
|
| int is_auto_rotate_enabled_by_user_for_testing_ = -1;
|
|
|