 Chromium Code Reviews
 Chromium Code Reviews Issue 2904263002:
  [Media Controls] Tests for rotate-to-fullscreen meets orientation lock  (Closed)
    
  
    Issue 2904263002:
  [Media Controls] Tests for rotate-to-fullscreen meets orientation lock  (Closed) 
  | 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 { | 
| 
timvolodine
2017/05/31 18:07:21
nit: this is internal, but might semantically clas
 
johnme
2017/06/01 13:15:10
I renamed it to DeviceOrientationType. ScreenOrien
 | 
| + 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; | 
| 
timvolodine
2017/05/31 18:07:21
does this need to be an int? maybe just bool?
 
johnme
2017/06/01 13:15:10
Yes, because it's tri-state.
 | 
| + | 
| // `video_element_` owns MediaControlsImpl that owns |this|. | 
| Member<HTMLVideoElement> video_element_; | 
| }; |