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

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: Fix MSVC warning Created 3 years, 6 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..27da86920008aac063b002b2e1bc64b50537c29c 100644
--- a/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegate.h
+++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegate.h
@@ -8,10 +8,12 @@
#include "core/events/EventListener.h"
#include "device/screen_orientation/public/interfaces/screen_orientation.mojom-blink.h"
#include "modules/ModulesExport.h"
+#include "platform/wtf/Optional.h"
#include "public/platform/modules/screen_orientation/WebScreenOrientationLockType.h"
namespace blink {
+class DeviceOrientationData;
class DeviceOrientationEvent;
class Document;
class HTMLVideoElement;
@@ -69,6 +71,7 @@ class MediaControlsOrientationLockDelegate final : public EventListener {
private:
friend class MediaControlsOrientationLockDelegateTest;
+ friend class MediaControlsOrientationLockAndRotateToFullscreenDelegateTest;
enum class State {
kPendingFullscreen,
@@ -76,6 +79,14 @@ class MediaControlsOrientationLockDelegate final : public EventListener {
kMaybeLockedFullscreen,
};
+ enum class DeviceOrientationType {
+ kUnknown,
+ kFlat,
+ kDiagonal,
+ kPortrait,
+ kLandscape
+ };
+
// EventListener implementation.
void handleEvent(ExecutionContext*, Event*) override;
@@ -98,6 +109,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 +124,8 @@ class MediaControlsOrientationLockDelegate final : public EventListener {
device::mojom::blink::ScreenOrientationListenerPtr monitor_;
+ WTF::Optional<bool> is_auto_rotate_enabled_by_user_override_for_testing_;
+
// `video_element_` owns MediaControlsImpl that owns |this|.
Member<HTMLVideoElement> video_element_;
};

Powered by Google App Engine
This is Rietveld 408576698