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

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

Issue 2439483003: Link MediaSessionTabHelper with native MediaSession [CL is going to be split] (Closed)
Patch Set: addressed comments 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_android.cc
diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc
index 054aaffdaf89e1223c51cbe97b0bc4d8f44091b4..d2b2e987d41c6e0399dc8ea35cd94656f8114b26 100644
--- a/content/browser/web_contents/web_contents_android.cc
+++ b/content/browser/web_contents/web_contents_android.cc
@@ -21,6 +21,8 @@
#include "content/browser/frame_host/interstitial_page_impl.h"
#include "content/browser/media/android/browser_media_player_manager.h"
#include "content/browser/media/android/media_web_contents_observer_android.h"
+#include "content/browser/media/session/media_session.h"
+#include "content/browser/media/session/media_session_delegate_android.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/devtools_messages.h"
@@ -613,19 +615,12 @@ void WebContentsAndroid::RequestAccessibilitySnapshot(
snapshot_callback);
}
-void WebContentsAndroid::ResumeMediaSession(JNIEnv* env,
- const JavaParamRef<jobject>& obj) {
- web_contents_->ResumeMediaSession();
-}
-
-void WebContentsAndroid::SuspendMediaSession(JNIEnv* env,
- const JavaParamRef<jobject>& obj) {
- web_contents_->SuspendMediaSession();
-}
-
-void WebContentsAndroid::StopMediaSession(JNIEnv* env,
- const JavaParamRef<jobject>& obj) {
- web_contents_->StopMediaSession();
+void WebContentsAndroid::AddMediaSessionDelegate(
whywhat 2016/10/21 18:28:15 When is the delegate going to be removed? Do you t
+ JNIEnv* env,
+ const JavaParamRef<jobject>& obj,
+ const JavaParamRef<jobject>& j_delegate) {
+ MediaSessionDelegateAndroid::CreateAndConnect(
+ MediaSession::Get(web_contents()), env, j_delegate);
}
ScopedJavaLocalRef<jstring> WebContentsAndroid::GetEncoding(

Powered by Google App Engine
This is Rietveld 408576698