Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Unified Diff: third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegate.h

Issue 2904263002: [Media Controls] Tests for rotate-to-fullscreen meets orientation lock (Closed)
Patch Set: Address Tim's nits Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..01aa54906b06c040d1e0c7a12ec9c8aec2368040 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 DeviceOrientationType {
+ 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 DeviceOrientationType
+ 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/06/05 13:26:42 Can you make this `base::Optional<bool>`?
johnme 2017/06/14 17:46:42 Done.
+
// `video_element_` owns MediaControlsImpl that owns |this|.
Member<HTMLVideoElement> video_element_;
};

Powered by Google App Engine
This is Rietveld 408576698