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..49f504e8f2dae1f8b384d5e895f78b9de75d6197 100644 |
--- a/content/browser/web_contents/web_contents_android.cc |
+++ b/content/browser/web_contents/web_contents_android.cc |
@@ -11,6 +11,7 @@ |
#include "base/android/jni_string.h" |
#include "base/command_line.h" |
#include "base/containers/hash_tables.h" |
+#include "base/memory/ptr_util.h" |
#include "base/json/json_writer.h" |
#include "base/lazy_instance.h" |
#include "base/logging.h" |
@@ -21,6 +22,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 +616,11 @@ 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(JNIEnv* env, |
+ const JavaParamRef<jobject>& obj, |
+ const JavaParamRef<jobject>& j_delegate) { |
+ MediaSessionDelegateAndroid::CreateAndRegister( |
whywhat
2016/10/20 15:38:33
perhaps the delegates could be owned by WebContent
Zhiqiang Zhang (Slow)
2016/10/20 16:22:32
I prefer not to pollute WebContents. Actually Medi
whywhat
2016/10/20 18:21:16
Can we just own MSO in MediaSession and avoid usin
|
+ env, MediaSession::Get(web_contents()), j_delegate); |
} |
ScopedJavaLocalRef<jstring> WebContentsAndroid::GetEncoding( |