Chromium Code Reviews| 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 a41b2eb7c943c2c82a280e1ab8b014ef5bb4c86f..af72175e54273673f43e45704eea876ce75b4910 100644 |
| --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegate.h |
| +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegate.h |
| @@ -12,6 +12,7 @@ |
| namespace blink { |
| +class DeviceOrientationData; |
| class DeviceOrientationEvent; |
| class Document; |
| class HTMLVideoElement; |
| @@ -69,6 +70,7 @@ class MediaControlsOrientationLockDelegate final : public EventListener { |
| private: |
| friend class MediaControlsOrientationLockDelegateTest; |
| + friend class MediaControlsOrientationLockAndRotateToFullscreenDelegateTest; |
| enum class State { |
| kPendingFullscreen, |
| @@ -76,6 +78,14 @@ class MediaControlsOrientationLockDelegate final : public EventListener { |
| kMaybeLockedFullscreen, |
| }; |
| + enum class DeviceOrientation { |
| + kUnknown, |
| + kFlat, |
| + kDiagonal, |
| + kPortrait, |
| + kLandscape |
| + }; |
| + |
| // EventListener implementation. |
| void handleEvent(ExecutionContext*, Event*) override; |
| @@ -98,6 +108,9 @@ class MediaControlsOrientationLockDelegate final : public EventListener { |
| void MaybeListenToDeviceOrientation(); |
| void GotIsAutoRotateEnabledByUser(bool enabled); |
| + MODULES_EXPORT DeviceOrientation |
| + ComputeDeviceOrientation(DeviceOrientationData*) const; |
| + |
| void MaybeUnlockIfDeviceOrientationMatchesVideo(DeviceOrientationEvent*); |
| // Current state of the object. See comment at the top of the file for a |
| @@ -110,6 +123,8 @@ class MediaControlsOrientationLockDelegate final : public EventListener { |
| device::mojom::blink::ScreenOrientationListenerPtr monitor_; |
| + int is_auto_rotate_enabled_by_user_for_testing_ = -1; |
|
mlamouri (slow - plz ping)
2017/05/26 20:02:47
Could we avoid adding this by either mocking the m
johnme
2017/05/30 12:40:54
No-one's mocked a Platform Mojo service from Blink
|
| + |
| // `video_element_` owns MediaControlsImpl that owns |this|. |
| Member<HTMLVideoElement> video_element_; |
| }; |