| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/media/android/remote/remote_media_player_bridge.h" | 5 #include "chrome/browser/media/android/remote/remote_media_player_bridge.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 * to compile the constructor call. | 35 * to compile the constructor call. |
| 36 */ | 36 */ |
| 37 void DoNothing(int /*i*/) {} | 37 void DoNothing(int /*i*/) {} |
| 38 } | 38 } |
| 39 | 39 |
| 40 namespace remote_media { | 40 namespace remote_media { |
| 41 | 41 |
| 42 RemoteMediaPlayerBridge::RemoteMediaPlayerBridge( | 42 RemoteMediaPlayerBridge::RemoteMediaPlayerBridge( |
| 43 int player_id, | 43 int player_id, |
| 44 const std::string& user_agent, | 44 const std::string& user_agent, |
| 45 bool hide_url_log, | |
| 46 RemoteMediaPlayerManager* manager) | 45 RemoteMediaPlayerManager* manager) |
| 47 : MediaPlayerAndroid( | 46 : MediaPlayerAndroid( |
| 48 player_id, | 47 player_id, |
| 49 manager, | 48 manager, |
| 50 base::Bind(&DoNothing), | 49 base::Bind(&DoNothing), |
| 51 manager->GetLocalPlayer(player_id)->frame_url(), | 50 manager->GetLocalPlayer(player_id)->frame_url(), |
| 52 // TODO(davve): Media session interaction with remote | 51 // TODO(davve): Media session interaction with remote |
| 53 // playback not defined. Use invalid session id for now. | 52 // playback not defined. Use invalid session id for now. |
| 54 // https://github.com/whatwg/mediasession/issues/123 | 53 // https://github.com/whatwg/mediasession/issues/123 |
| 55 media::kInvalidMediaSessionId), | 54 media::kInvalidMediaSessionId), |
| 56 width_(0), | 55 width_(0), |
| 57 height_(0), | 56 height_(0), |
| 58 hide_url_log_(hide_url_log), | |
| 59 url_(manager->GetLocalPlayer(player_id)->GetUrl()), | 57 url_(manager->GetLocalPlayer(player_id)->GetUrl()), |
| 60 first_party_for_cookies_( | 58 first_party_for_cookies_( |
| 61 manager->GetLocalPlayer(player_id)->GetFirstPartyForCookies()), | 59 manager->GetLocalPlayer(player_id)->GetFirstPartyForCookies()), |
| 62 user_agent_(user_agent), | 60 user_agent_(user_agent), |
| 63 weak_factory_(this) { | 61 weak_factory_(this) { |
| 64 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 62 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 65 JNIEnv* env = base::android::AttachCurrentThread(); | 63 JNIEnv* env = base::android::AttachCurrentThread(); |
| 66 CHECK(env); | 64 CHECK(env); |
| 67 ScopedJavaLocalRef<jstring> j_url_string; | 65 ScopedJavaLocalRef<jstring> j_url_string; |
| 68 if (url_.is_valid()) { | 66 if (url_.is_valid()) { |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 Java_RemoteMediaPlayerBridge_setCookies( | 482 Java_RemoteMediaPlayerBridge_setCookies( |
| 485 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); | 483 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); |
| 486 } | 484 } |
| 487 | 485 |
| 488 MediaPlayerAndroid* RemoteMediaPlayerBridge::GetLocalPlayer() { | 486 MediaPlayerAndroid* RemoteMediaPlayerBridge::GetLocalPlayer() { |
| 489 return static_cast<RemoteMediaPlayerManager*>(manager())->GetLocalPlayer( | 487 return static_cast<RemoteMediaPlayerManager*>(manager())->GetLocalPlayer( |
| 490 player_id()); | 488 player_id()); |
| 491 } | 489 } |
| 492 | 490 |
| 493 } // namespace remote_media | 491 } // namespace remote_media |
| OLD | NEW |