| 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_manager.h" | 5 #include "chrome/browser/media/android/remote/remote_media_player_manager.h" |
| 6 | 6 |
| 7 #include "chrome/browser/android/tab_android.h" | 7 #include "chrome/browser/android/tab_android.h" |
| 8 #include "chrome/common/chrome_content_client.h" | 8 #include "chrome/common/chrome_content_client.h" |
| 9 #include "content/common/media/media_player_messages_android.h" | 9 #include "content/common/media/media_player_messages_android.h" |
| 10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (player) | 67 if (player) |
| 68 player->RequestRemotePlayback(); | 68 player->RequestRemotePlayback(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void RemoteMediaPlayerManager::OnRequestRemotePlaybackControl(int player_id) { | 71 void RemoteMediaPlayerManager::OnRequestRemotePlaybackControl(int player_id) { |
| 72 RemoteMediaPlayerBridge* player = GetRemotePlayer(player_id); | 72 RemoteMediaPlayerBridge* player = GetRemotePlayer(player_id); |
| 73 if (player) | 73 if (player) |
| 74 player->RequestRemotePlaybackControl(); | 74 player->RequestRemotePlaybackControl(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void RemoteMediaPlayerManager::OnRequestRemotePlaybackStop(int player_id) { |
| 78 RemoteMediaPlayerBridge* player = GetRemotePlayer(player_id); |
| 79 if (player) |
| 80 player->RequestRemotePlaybackStop(); |
| 81 } |
| 82 |
| 77 bool RemoteMediaPlayerManager::IsPlayingRemotely(int player_id) { | 83 bool RemoteMediaPlayerManager::IsPlayingRemotely(int player_id) { |
| 78 return players_playing_remotely_.count(player_id) != 0; | 84 return players_playing_remotely_.count(player_id) != 0; |
| 79 } | 85 } |
| 80 | 86 |
| 81 int RemoteMediaPlayerManager::GetTabId() { | 87 int RemoteMediaPlayerManager::GetTabId() { |
| 82 if (!web_contents()) | 88 if (!web_contents()) |
| 83 return -1; | 89 return -1; |
| 84 | 90 |
| 85 TabAndroid* tab = TabAndroid::FromWebContents(web_contents()); | 91 TabAndroid* tab = TabAndroid::FromWebContents(web_contents()); |
| 86 if (!tab) | 92 if (!tab) |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 MediaPlayerAndroid* local_player = GetLocalPlayer(player_id); | 283 MediaPlayerAndroid* local_player = GetLocalPlayer(player_id); |
| 278 Send(new MediaPlayerMsg_MediaMetadataChanged( | 284 Send(new MediaPlayerMsg_MediaMetadataChanged( |
| 279 RoutingID(), player_id, duration, local_player->GetVideoWidth(), | 285 RoutingID(), player_id, duration, local_player->GetVideoWidth(), |
| 280 local_player->GetVideoHeight(), success)); | 286 local_player->GetVideoHeight(), success)); |
| 281 } else { | 287 } else { |
| 282 BrowserMediaPlayerManager::OnMediaMetadataChanged(player_id, duration, | 288 BrowserMediaPlayerManager::OnMediaMetadataChanged(player_id, duration, |
| 283 width, height, success); | 289 width, height, success); |
| 284 } | 290 } |
| 285 } | 291 } |
| 286 } // namespace remote_media | 292 } // namespace remote_media |
| OLD | NEW |