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

Unified Diff: content/browser/media/session/media_session_service_impl.cc

Issue 2479603003: Revert of Adding new media controls to MediaNotification (Closed)
Patch Set: Created 4 years, 1 month 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/media/session/media_session_service_impl.cc
diff --git a/content/browser/media/session/media_session_service_impl.cc b/content/browser/media/session/media_session_service_impl.cc
index 589823fab2b78f83bf7575e5044575a57642f1eb..f0f5431c2300325fc6dee976a70fdfd53b47f572 100644
--- a/content/browser/media/session/media_session_service_impl.cc
+++ b/content/browser/media/session/media_session_service_impl.cc
@@ -14,17 +14,9 @@
MediaSessionServiceImpl::MediaSessionServiceImpl(
RenderFrameHost* render_frame_host)
- : render_frame_host_(render_frame_host) {
- MediaSessionImpl* session = GetMediaSession();
- if (session)
- session->SetMediaSessionService(this);
-}
+ : render_frame_host_(render_frame_host) {}
-MediaSessionServiceImpl::~MediaSessionServiceImpl() {
- MediaSessionImpl* session = GetMediaSession();
- if (session && session->GetMediaSessionService() == this)
- session->SetMediaSessionService(nullptr);
-}
+MediaSessionServiceImpl::~MediaSessionServiceImpl() = default;
// static
void MediaSessionServiceImpl::Create(
@@ -51,33 +43,22 @@
return;
}
- MediaSessionImpl* session = GetMediaSession();
- if (session)
- session->SetMetadata(metadata);
+ WebContentsImpl* contents = static_cast<WebContentsImpl*>(
+ WebContentsImpl::FromRenderFrameHost(render_frame_host_));
+ if (contents)
+ MediaSessionImpl::Get(contents)->SetMetadata(metadata);
}
void MediaSessionServiceImpl::EnableAction(
blink::mojom::MediaSessionAction action) {
- MediaSessionImpl* session = GetMediaSession();
- if (session)
- session->OnMediaSessionEnabledAction(action);
+ // TODO(zqzhang): Plumb this signal to Java. See https://crbug.com/656563
+ NOTIMPLEMENTED();
}
void MediaSessionServiceImpl::DisableAction(
blink::mojom::MediaSessionAction action) {
- MediaSessionImpl* session = GetMediaSession();
- if (session)
- session->OnMediaSessionDisabledAction(action);
-}
-
-MediaSessionImpl* MediaSessionServiceImpl::GetMediaSession() {
- WebContentsImpl* contents = static_cast<WebContentsImpl*>(
- WebContentsImpl::FromRenderFrameHost(render_frame_host_));
- if (!contents)
- return nullptr;
- if (render_frame_host_ != contents->GetMainFrame())
- return nullptr;
- return MediaSessionImpl::Get(contents);
+ // TODO(zqzhang): Plumb this signal to Java. See https://crbug.com/656563
+ NOTIMPLEMENTED();
}
void MediaSessionServiceImpl::Bind(

Powered by Google App Engine
This is Rietveld 408576698