Chromium Code Reviews| Index: third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp |
| diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp |
| index 227a699e50ef135548a91979550a1ffee8388c58..18f59f294709ff4fa1503e4abb60dc93b7ddd5a9 100644 |
| --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp |
| +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp |
| @@ -45,6 +45,7 @@ |
| #include "core/layout/LayoutTheme.h" |
| #include "modules/media_controls/MediaControlsMediaEventListener.h" |
| #include "modules/media_controls/MediaControlsOrientationLockDelegate.h" |
| +#include "modules/media_controls/MediaControlsRotateToFullscreenDelegate.h" |
| #include "modules/media_controls/MediaControlsWindowEventListener.h" |
| #include "modules/media_controls/elements/MediaControlCastButtonElement.h" |
| #include "modules/media_controls/elements/MediaControlCurrentTimeDisplayElement.h" |
| @@ -223,6 +224,7 @@ MediaControlsImpl::MediaControlsImpl(HTMLMediaElement& media_element) |
| WTF::Bind(&MediaControlsImpl::HideAllMenus, |
| WrapWeakPersistent(this)))), |
| orientation_lock_delegate_(nullptr), |
| + rotate_to_fullscreen_delegate_(nullptr), |
| hide_media_controls_timer_( |
| TaskRunnerHelper::Get(TaskType::kUnspecedTimer, |
| &media_element.GetDocument()), |
| @@ -250,9 +252,16 @@ MediaControlsImpl* MediaControlsImpl::Create(HTMLMediaElement& media_element, |
| controls->InitializeControls(); |
| controls->Reset(); |
| - // Initialize the orientation lock when going fullscreen feature. |
| - if (RuntimeEnabledFeatures::videoFullscreenOrientationLockEnabled() && |
| + if (RuntimeEnabledFeatures::videoRotateToFullscreenEnabled() && |
| media_element.IsHTMLVideoElement()) { |
| + // Initialize the rotate-to-fullscreen feature. |
| + controls->rotate_to_fullscreen_delegate_ = |
| + new MediaControlsRotateToFullscreenDelegate( |
| + toHTMLVideoElement(media_element)); |
| + } // TODO(johnme): Make it possible to use both features simultaneously. |
|
mlamouri (slow - plz ping)
2017/04/19 17:10:45
Maybe say that they are not compatible now so if t
johnme
2017/04/19 18:21:28
Done.
|
| + else if (RuntimeEnabledFeatures::videoFullscreenOrientationLockEnabled() && |
| + media_element.IsHTMLVideoElement()) { |
| + // Initialize the orientation lock when going fullscreen feature. |
| controls->orientation_lock_delegate_ = |
| new MediaControlsOrientationLockDelegate( |
| toHTMLVideoElement(media_element)); |
| @@ -410,6 +419,8 @@ Node::InsertionNotificationRequest MediaControlsImpl::InsertedInto( |
| media_event_listener_->Attach(); |
| if (orientation_lock_delegate_) |
| orientation_lock_delegate_->Attach(); |
| + if (rotate_to_fullscreen_delegate_) |
| + rotate_to_fullscreen_delegate_->Attach(); |
| if (!resize_observer_) { |
| resize_observer_ = |
| @@ -432,6 +443,8 @@ void MediaControlsImpl::RemovedFrom(ContainerNode*) { |
| media_event_listener_->Detach(); |
| if (orientation_lock_delegate_) |
| orientation_lock_delegate_->Detach(); |
| + if (rotate_to_fullscreen_delegate_) |
| + rotate_to_fullscreen_delegate_->Detach(); |
| resize_observer_.Clear(); |
| } |
| @@ -1132,6 +1145,7 @@ DEFINE_TRACE(MediaControlsImpl) { |
| visitor->Trace(media_event_listener_); |
| visitor->Trace(window_event_listener_); |
| visitor->Trace(orientation_lock_delegate_); |
| + visitor->Trace(rotate_to_fullscreen_delegate_); |
| MediaControls::Trace(visitor); |
| HTMLDivElement::Trace(visitor); |
| } |