| 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 18 matching lines...) Expand all Loading... |
| 29 * Dummy function for RequestMediaResources callback. The callback is never | 29 * Dummy function for RequestMediaResources callback. The callback is never |
| 30 * actually called by MediaPlayerAndroid or RemoteMediaPlayer but is needed | 30 * actually called by MediaPlayerAndroid or RemoteMediaPlayer but is needed |
| 31 * to compile the constructor call. | 31 * to compile the constructor call. |
| 32 */ | 32 */ |
| 33 void DoNothing(int /*i*/) {} | 33 void DoNothing(int /*i*/) {} |
| 34 } | 34 } |
| 35 | 35 |
| 36 namespace remote_media { | 36 namespace remote_media { |
| 37 | 37 |
| 38 RemoteMediaPlayerBridge::RemoteMediaPlayerBridge( | 38 RemoteMediaPlayerBridge::RemoteMediaPlayerBridge( |
| 39 MediaPlayerAndroid* local_player, const std::string& user_agent, | 39 MediaPlayerAndroid* local_player, |
| 40 bool hide_url_log, RemoteMediaPlayerManager* manager) | 40 const std::string& user_agent, |
| 41 : MediaPlayerAndroid(local_player->player_id(), manager, | 41 bool hide_url_log, |
| 42 RemoteMediaPlayerManager* manager) |
| 43 : MediaPlayerAndroid(local_player->player_id(), |
| 44 manager, |
| 42 base::Bind(&DoNothing), | 45 base::Bind(&DoNothing), |
| 43 local_player->frame_url()), | 46 local_player->frame_url(), |
| 47 local_player->session_id()), |
| 44 start_position_millis_(0), | 48 start_position_millis_(0), |
| 45 local_player_(local_player), | 49 local_player_(local_player), |
| 46 width_(0), | 50 width_(0), |
| 47 height_(0), | 51 height_(0), |
| 48 hide_url_log_(hide_url_log), | 52 hide_url_log_(hide_url_log), |
| 49 volume_(-1.0), | 53 volume_(-1.0), |
| 50 url_(local_player->GetUrl()), | 54 url_(local_player->GetUrl()), |
| 51 first_party_for_cookies_(local_player->GetFirstPartyForCookies()), | 55 first_party_for_cookies_(local_player->GetFirstPartyForCookies()), |
| 52 user_agent_(user_agent), | 56 user_agent_(user_agent), |
| 53 weak_factory_(this) { | 57 weak_factory_(this) { |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 // TODO(aberent) Do we need to retrieve auth credentials for basic | 417 // TODO(aberent) Do we need to retrieve auth credentials for basic |
| 414 // authentication? MediaPlayerBridge does. | 418 // authentication? MediaPlayerBridge does. |
| 415 cookies_ = cookies; | 419 cookies_ = cookies; |
| 416 JNIEnv* env = AttachCurrentThread(); | 420 JNIEnv* env = AttachCurrentThread(); |
| 417 CHECK(env); | 421 CHECK(env); |
| 418 Java_RemoteMediaPlayerBridge_setCookies( | 422 Java_RemoteMediaPlayerBridge_setCookies( |
| 419 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); | 423 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); |
| 420 } | 424 } |
| 421 | 425 |
| 422 } // namespace remote_media | 426 } // namespace remote_media |
| OLD | NEW |