[Modern Media Controls] Turn modern media controls on by default
[WebKit-https.git] / Source / WebCore / Modules / mediacontrols / MediaControlsHost.cpp
index 0420d72..8d8eeff 100644 (file)
@@ -102,7 +102,7 @@ Vector<RefPtr<AudioTrack>> MediaControlsHost::sortedTrackListForMenu(AudioTrackL
     return page->group().captionPreferences().sortedTrackListForMenu(&trackList);
 }
 
-String MediaControlsHost::displayNameForTrack(const Optional<TextOrAudioTrack>& track)
+String MediaControlsHost::displayNameForTrack(const std::optional<TextOrAudioTrack>& track)
 {
     if (!track)
         return emptyString();
@@ -126,7 +126,7 @@ TextTrack* MediaControlsHost::captionMenuAutomaticItem()
     return TextTrack::captionMenuAutomaticItem();
 }
 
-AtomicString MediaControlsHost::captionDisplayMode()
+AtomicString MediaControlsHost::captionDisplayMode() const
 {
     Page* page = m_mediaElement->document().page();
     if (!page)
@@ -190,16 +190,21 @@ bool MediaControlsHost::allowsInlineMediaPlayback() const
     return !m_mediaElement->mediaSession().requiresFullscreenForVideoPlayback(*m_mediaElement);
 }
 
-bool MediaControlsHost::supportsFullscreen()
+bool MediaControlsHost::supportsFullscreen() const
 {
     return m_mediaElement->supportsFullscreen(HTMLMediaElementEnums::VideoFullscreenModeStandard);
 }
 
-bool MediaControlsHost::isVideoLayerInline()
+bool MediaControlsHost::isVideoLayerInline() const
 {
     return m_mediaElement->isVideoLayerInline();
 }
 
+bool MediaControlsHost::isInMediaDocument() const
+{
+    return m_mediaElement->document().isMediaDocument();
+}
+
 void MediaControlsHost::setPreparedToReturnVideoLayerToInline(bool value)
 {
     m_mediaElement->setPreparedToReturnVideoLayerToInline(value);
@@ -273,7 +278,7 @@ String MediaControlsHost::shadowRootCSSText() const
     Page* page = m_mediaElement->document().page();
     if (!page)
         return emptyString();
-    return RenderTheme::themeForPage(page)->mediaControlsStyleSheet();
+    return RenderTheme::themeForPage(page)->modernMediaControlsStyleSheet();
 }
 
 String MediaControlsHost::base64StringForIconAndPlatform(const String& iconName, const String& platform) const