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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2411723002: Split MediaSessionStateChanged() and MediaSessionMetadataChanged() (Closed)
Patch Set: rebased Created 4 years, 2 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: 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 6ceef4289ec0a5aafb1a3450fd076b051b6569c9..a8828b5a93c18e5aeaf50b40032c5558636fa786 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3818,10 +3818,17 @@ void WebContentsImpl::OnUpdateFaviconURL(
void WebContentsImpl::OnMediaSessionStateChanged() {
MediaSession* session = MediaSession::Get(this);
- FOR_EACH_OBSERVER(WebContentsObserver, observers_,
- MediaSessionStateChanged(session->IsControllable(),
- session->IsSuspended(),
- session->metadata()));
+ for (auto& observer : observers_) {
+ observer.MediaSessionStateChanged(session->IsControllable(),
+ session->IsSuspended());
+ }
+}
+
+void WebContentsImpl::OnMediaSessionMetadataChanged() {
+ MediaSession* session = MediaSession::Get(this);
+ for (auto& observer : observers_) {
+ observer.MediaSessionMetadataChanged(session->metadata());
+ }
}
void WebContentsImpl::ResumeMediaSession() {

Powered by Google App Engine
This is Rietveld 408576698