Chromium Code Reviews| Index: content/browser/web_contents/web_contents_impl.cc |
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc |
| index 683bd7154d435222b2627e276aa7c6a001a10d12..f6b6997ccd30c583ec66b2b820d5db8bdfaa00f0 100644 |
| --- a/content/browser/web_contents/web_contents_impl.cc |
| +++ b/content/browser/web_contents/web_contents_impl.cc |
| @@ -132,6 +132,7 @@ |
| #if defined(OS_ANDROID) |
| #include "content/browser/android/content_video_view.h" |
| #include "content/browser/android/date_time_chooser_android.h" |
| +#include "content/browser/media/android/browser_media_session_manager.h" |
| #include "content/browser/media/android/media_web_contents_observer_android.h" |
| #include "content/browser/web_contents/web_contents_android.h" |
| #endif // OS_ANDROID |
| @@ -3814,10 +3815,19 @@ void WebContentsImpl::OnUpdateFaviconURL( |
| void WebContentsImpl::OnMediaSessionStateChanged() { |
| MediaSession* session = MediaSession::Get(this); |
| + base::Optional<MediaMetadata> metadata; |
| +#if defined(OS_ANDROID) |
|
whywhat
2016/09/13 16:23:26
does it have to be android only? I thought we have
Zhiqiang Zhang (Slow)
2016/09/13 17:15:56
Yes, BrowserMediaSessionManager is in content/brow
|
| + BrowserMediaSessionManager* session_manager = |
| + static_cast<MediaWebContentsObserverAndroid*>( |
| + media_web_contents_observer()) |
| + ->GetMediaSessionManager(GetMainFrame()); |
| + if (session_manager->media_metadata()) { |
| + metadata = *session_manager->media_metadata(); |
| + } |
| +#endif // defined(OS_ANDROID) |
| FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
| MediaSessionStateChanged(session->IsControllable(), |
| - session->IsSuspended(), |
| - session->metadata())); |
| + session->IsSuspended(), metadata)); |
| } |
| void WebContentsImpl::ResumeMediaSession() { |