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::OnSeekCompleted( |
| 169 JNIEnv* env, |
| 170 const JavaParamRef<jobject>& obj) { |
| 171 OnSeekComplete(); |
| 172 } |
| 173 |
168 void RemoteMediaPlayerBridge::Pause(bool is_media_related_action) { | 174 void RemoteMediaPlayerBridge::Pause(bool is_media_related_action) { |
169 // Ignore the pause if it's not from an event that is explicitly telling | 175 // 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 | 176 // 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 | 177 // reasons, such as freeing resources, etc. and during those times, the |
172 // remote video playback should not be paused. | 178 // remote video playback should not be paused. |
173 if (is_media_related_action) { | 179 if (is_media_related_action) { |
174 JNIEnv* env = AttachCurrentThread(); | 180 JNIEnv* env = AttachCurrentThread(); |
175 Java_RemoteMediaPlayerBridge_pause(env, java_bridge_.obj()); | 181 Java_RemoteMediaPlayerBridge_pause(env, java_bridge_.obj()); |
176 time_update_timer_.Stop(); | 182 time_update_timer_.Stop(); |
177 } | 183 } |
(...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 | 419 // TODO(aberent) Do we need to retrieve auth credentials for basic |
414 // authentication? MediaPlayerBridge does. | 420 // authentication? MediaPlayerBridge does. |
415 cookies_ = cookies; | 421 cookies_ = cookies; |
416 JNIEnv* env = AttachCurrentThread(); | 422 JNIEnv* env = AttachCurrentThread(); |
417 CHECK(env); | 423 CHECK(env); |
418 Java_RemoteMediaPlayerBridge_setCookies( | 424 Java_RemoteMediaPlayerBridge_setCookies( |
419 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); | 425 env, java_bridge_.obj(), ConvertUTF8ToJavaString(env, cookies).obj()); |
420 } | 426 } |
421 | 427 |
422 } // namespace remote_media | 428 } // namespace remote_media |
OLD | NEW |