Chromium Code Reviews| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 &RemoteMediaPlayerBridge::OnTimeUpdateTimerFired); | 158 &RemoteMediaPlayerBridge::OnTimeUpdateTimerFired); |
| 159 } | 159 } |
| 160 } | 160 } |
| 161 | 161 |
| 162 void RemoteMediaPlayerBridge::OnCastStopping(JNIEnv* env, | 162 void RemoteMediaPlayerBridge::OnCastStopping(JNIEnv* env, |
| 163 const JavaParamRef<jobject>& obj) { | 163 const JavaParamRef<jobject>& obj) { |
| 164 static_cast<RemoteMediaPlayerManager*>(manager()) | 164 static_cast<RemoteMediaPlayerManager*>(manager()) |
| 165 ->SwitchToLocalPlayer(player_id()); | 165 ->SwitchToLocalPlayer(player_id()); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void RemoteMediaPlayerBridge::OnSeekComplete(JNIEnv* env, | |
| 169 const JavaParamRef<jobject>& obj, | |
| 170 const int position) { | |
| 171 static_cast<RemoteMediaPlayerManager*>(manager())->OnSeekComplete( | |
| 172 player_id(), base::TimeDelta::FromMilliseconds(position)); | |
|
aberent
2016/01/13 15:53:47
Might be better if this just called the existing o
dgn
2016/01/13 17:05:42
Done.
| |
| 173 } | |
| 174 | |
| 168 void RemoteMediaPlayerBridge::Pause(bool is_media_related_action) { | 175 void RemoteMediaPlayerBridge::Pause(bool is_media_related_action) { |
| 169 // Ignore the pause if it's not from an event that is explicitly telling | 176 // Ignore the pause if it's not from an event that is explicitly telling |
| 170 // the video to pause. It's possible for Pause() to be called for other | 177 // the video to pause. It's possible for Pause() to be called for other |
| 171 // reasons, such as freeing resources, etc. and during those times, the | 178 // reasons, such as freeing resources, etc. and during those times, the |
| 172 // remote video playback should not be paused. | 179 // remote video playback should not be paused. |
| 173 if (is_media_related_action) { | 180 if (is_media_related_action) { |
| 174 JNIEnv* env = AttachCurrentThread(); | 181 JNIEnv* env = AttachCurrentThread(); |
| 175 Java_RemoteMediaPlayerBridge_pause(env, java_bridge_.obj()); | 182 Java_RemoteMediaPlayerBridge_pause(env, java_bridge_.obj()); |
| 176 time_update_timer_.Stop(); | 183 time_update_timer_.Stop(); |
| 177 } | 184 } |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 // TODO(aberent) Do we need to retrieve auth credentials for basic | 420 // TODO(aberent) Do we need to retrieve auth credentials for basic |
| 414 // authentication? MediaPlayerBridge does. | 421 // authentication? MediaPlayerBridge does. |
| 415 cookies_ = cookies; | 422 cookies_ = cookies; |
| 416 JNIEnv* env = AttachCurrentThread(); | 423 JNIEnv* env = AttachCurrentThread(); |
| 417 CHECK(env); | 424 CHECK(env); |
| 418 Java_RemoteMediaPlayerBridge_setCookies( | 425 Java_RemoteMediaPlayerBridge_setCookies( |
| 419 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); | 426 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); |
| 420 } | 427 } |
| 421 | 428 |
| 422 } // namespace remote_media | 429 } // namespace remote_media |
| OLD | NEW |