Index: third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp |
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp |
index 71d89b35e4e776ac71a0738f96e19a9387791acd..ca8e1e597b25fa4ecc147382d7a4d53d232a0ee0 100644 |
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp |
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsOrientationLockDelegate.cpp |
@@ -71,22 +71,26 @@ MediaControlsOrientationLockDelegate::MediaControlsOrientationLockDelegate( |
void MediaControlsOrientationLockDelegate::attach() { |
DCHECK(videoElement().isConnected()); |
- document().addEventListener(EventTypeNames::fullscreenchange, this, true); |
- videoElement().addEventListener(EventTypeNames::webkitfullscreenchange, this, |
- true); |
videoElement().addEventListener(EventTypeNames::loadedmetadata, this, true); |
} |
void MediaControlsOrientationLockDelegate::detach() { |
DCHECK(!videoElement().isConnected()); |
- document().removeEventListener(EventTypeNames::fullscreenchange, this, true); |
- videoElement().removeEventListener(EventTypeNames::webkitfullscreenchange, |
- this, true); |
videoElement().removeEventListener(EventTypeNames::loadedmetadata, this, |
true); |
} |
+void MediaControlsOrientationLockDelegate::didEnterFullscreen() { |
+ if (m_state == State::PendingFullscreen) |
+ maybeLockOrientation(); |
+} |
+ |
+void MediaControlsOrientationLockDelegate::didExitFullscreen() { |
+ if (m_state != State::PendingFullscreen) |
+ maybeUnlockOrientation(); |
+} |
+ |
bool MediaControlsOrientationLockDelegate::operator==( |
const EventListener& other) const { |
return this == &other; |
@@ -151,19 +155,6 @@ Document& MediaControlsOrientationLockDelegate::document() const { |
void MediaControlsOrientationLockDelegate::handleEvent( |
ExecutionContext* executionContext, |
Event* event) { |
- if (event->type() == EventTypeNames::fullscreenchange || |
- event->type() == EventTypeNames::webkitfullscreenchange) { |
- if (videoElement().isFullscreen()) { |
- if (m_state == State::PendingFullscreen) |
- maybeLockOrientation(); |
- } else { |
- if (m_state != State::PendingFullscreen) |
- maybeUnlockOrientation(); |
- } |
- |
- return; |
- } |
- |
if (event->type() == EventTypeNames::loadedmetadata) { |
if (m_state == State::PendingMetadata) |
maybeLockOrientation(); |