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 25 matching lines...) Expand all Loading... |
36 void DoNothing(int /*i*/) {} | 36 void DoNothing(int /*i*/) {} |
37 } | 37 } |
38 | 38 |
39 namespace remote_media { | 39 namespace remote_media { |
40 | 40 |
41 RemoteMediaPlayerBridge::RemoteMediaPlayerBridge( | 41 RemoteMediaPlayerBridge::RemoteMediaPlayerBridge( |
42 int player_id, | 42 int player_id, |
43 const std::string& user_agent, | 43 const std::string& user_agent, |
44 bool hide_url_log, | 44 bool hide_url_log, |
45 RemoteMediaPlayerManager* manager) | 45 RemoteMediaPlayerManager* manager) |
46 : MediaPlayerAndroid(player_id, | 46 : MediaPlayerAndroid( |
47 manager, | 47 player_id, |
48 base::Bind(&DoNothing), | 48 manager, |
49 manager->GetLocalPlayer(player_id)->frame_url()), | 49 base::Bind(&DoNothing), |
| 50 manager->GetLocalPlayer(player_id)->frame_url(), |
| 51 // TODO(davve): Media session interaction with remote |
| 52 // playback not defined. Use invalid session id for now. |
| 53 // https://github.com/whatwg/mediasession/issues/123 |
| 54 media::kInvalidMediaSessionId), |
50 width_(0), | 55 width_(0), |
51 height_(0), | 56 height_(0), |
52 hide_url_log_(hide_url_log), | 57 hide_url_log_(hide_url_log), |
53 url_(manager->GetLocalPlayer(player_id)->GetUrl()), | 58 url_(manager->GetLocalPlayer(player_id)->GetUrl()), |
54 first_party_for_cookies_( | 59 first_party_for_cookies_( |
55 manager->GetLocalPlayer(player_id)->GetFirstPartyForCookies()), | 60 manager->GetLocalPlayer(player_id)->GetFirstPartyForCookies()), |
56 user_agent_(user_agent), | 61 user_agent_(user_agent), |
57 weak_factory_(this) { | 62 weak_factory_(this) { |
58 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 63 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
59 JNIEnv* env = base::android::AttachCurrentThread(); | 64 JNIEnv* env = base::android::AttachCurrentThread(); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 Java_RemoteMediaPlayerBridge_setCookies( | 474 Java_RemoteMediaPlayerBridge_setCookies( |
470 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); | 475 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); |
471 } | 476 } |
472 | 477 |
473 MediaPlayerAndroid* RemoteMediaPlayerBridge::GetLocalPlayer() { | 478 MediaPlayerAndroid* RemoteMediaPlayerBridge::GetLocalPlayer() { |
474 return static_cast<RemoteMediaPlayerManager*>(manager())->GetLocalPlayer( | 479 return static_cast<RemoteMediaPlayerManager*>(manager())->GetLocalPlayer( |
475 player_id()); | 480 player_id()); |
476 } | 481 } |
477 | 482 |
478 } // namespace remote_media | 483 } // namespace remote_media |
OLD | NEW |