| 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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 } | 456 } |
| 457 | 457 |
| 458 void RemoteMediaPlayerBridge::OnError( | 458 void RemoteMediaPlayerBridge::OnError( |
| 459 JNIEnv* env, const base::android::JavaParamRef<jobject>& obj) { | 459 JNIEnv* env, const base::android::JavaParamRef<jobject>& obj) { |
| 460 // TODO(https://crbug.com/585379) implement some useful codes for remote | 460 // TODO(https://crbug.com/585379) implement some useful codes for remote |
| 461 // playback. None of the existing MediaPlayerAndroid codes are | 461 // playback. None of the existing MediaPlayerAndroid codes are |
| 462 // relevant for remote playback. | 462 // relevant for remote playback. |
| 463 manager()->OnError(player_id(), MEDIA_ERROR_INVALID_CODE); | 463 manager()->OnError(player_id(), MEDIA_ERROR_INVALID_CODE); |
| 464 } | 464 } |
| 465 | 465 |
| 466 void RemoteMediaPlayerBridge::OnCancelledRemotePlaybackRequest( |
| 467 JNIEnv* env, const base::android::JavaParamRef<jobject>& obj) { |
| 468 static_cast<RemoteMediaPlayerManager*>(manager()) |
| 469 ->OnCancelledRemotePlaybackRequest(player_id()); |
| 470 } |
| 471 |
| 466 | 472 |
| 467 void RemoteMediaPlayerBridge::OnCookiesRetrieved(const std::string& cookies) { | 473 void RemoteMediaPlayerBridge::OnCookiesRetrieved(const std::string& cookies) { |
| 468 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 474 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 469 // TODO(aberent) Do we need to retrieve auth credentials for basic | 475 // TODO(aberent) Do we need to retrieve auth credentials for basic |
| 470 // authentication? MediaPlayerBridge does. | 476 // authentication? MediaPlayerBridge does. |
| 471 cookies_ = cookies; | 477 cookies_ = cookies; |
| 472 JNIEnv* env = AttachCurrentThread(); | 478 JNIEnv* env = AttachCurrentThread(); |
| 473 CHECK(env); | 479 CHECK(env); |
| 474 Java_RemoteMediaPlayerBridge_setCookies( | 480 Java_RemoteMediaPlayerBridge_setCookies( |
| 475 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); | 481 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); |
| 476 } | 482 } |
| 477 | 483 |
| 478 MediaPlayerAndroid* RemoteMediaPlayerBridge::GetLocalPlayer() { | 484 MediaPlayerAndroid* RemoteMediaPlayerBridge::GetLocalPlayer() { |
| 479 return static_cast<RemoteMediaPlayerManager*>(manager())->GetLocalPlayer( | 485 return static_cast<RemoteMediaPlayerManager*>(manager())->GetLocalPlayer( |
| 480 player_id()); | 486 player_id()); |
| 481 } | 487 } |
| 482 | 488 |
| 483 } // namespace remote_media | 489 } // namespace remote_media |
| OLD | NEW |