| 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 #ifndef CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_ | 6 #define CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/scoped_vector.h" | |
| 15 #include "chrome/browser/media/android/remote/remote_media_player_bridge.h" | 14 #include "chrome/browser/media/android/remote/remote_media_player_bridge.h" |
| 16 #include "content/browser/media/android/browser_media_player_manager.h" | 15 #include "content/browser/media/android/browser_media_player_manager.h" |
| 17 #include "media/base/android/media_player_android.h" | 16 #include "media/base/android/media_player_android.h" |
| 18 | 17 |
| 19 struct MediaPlayerHostMsg_Initialize_Params; | 18 struct MediaPlayerHostMsg_Initialize_Params; |
| 20 | 19 |
| 21 namespace blink { | 20 namespace blink { |
| 22 enum class WebRemotePlaybackAvailability; | 21 enum class WebRemotePlaybackAvailability; |
| 23 } | 22 } |
| 24 | 23 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 int http_status_code, | 98 int http_status_code, |
| 100 const GURL& image_url, | 99 const GURL& image_url, |
| 101 const std::vector<SkBitmap>& bitmaps, | 100 const std::vector<SkBitmap>& bitmaps, |
| 102 const std::vector<gfx::Size>& original_bitmap_sizes); | 101 const std::vector<gfx::Size>& original_bitmap_sizes); |
| 103 | 102 |
| 104 // Return the ID of the tab that's associated with this controller. Returns | 103 // Return the ID of the tab that's associated with this controller. Returns |
| 105 // -1 in case something goes wrong. | 104 // -1 in case something goes wrong. |
| 106 int GetTabId(); | 105 int GetTabId(); |
| 107 | 106 |
| 108 // Get the player that is not currently selected | 107 // Get the player that is not currently selected |
| 109 ScopedVector<media::MediaPlayerAndroid>::iterator GetAlternativePlayer( | 108 std::vector<std::unique_ptr<media::MediaPlayerAndroid>>::iterator |
| 110 int player_id); | 109 GetAlternativePlayer(int player_id); |
| 111 | 110 |
| 112 // Get the remote player for a given player id, whether or not it is currently | 111 // Get the remote player for a given player id, whether or not it is currently |
| 113 // playing remotely. | 112 // playing remotely. |
| 114 RemoteMediaPlayerBridge* GetRemotePlayer(int player_id); | 113 RemoteMediaPlayerBridge* GetRemotePlayer(int player_id); |
| 115 | 114 |
| 116 bool SwapCurrentPlayer(int player_id); | 115 bool SwapCurrentPlayer(int player_id); |
| 117 | 116 |
| 118 void FetchPosterBitmap(int player_id); | 117 void FetchPosterBitmap(int player_id); |
| 119 | 118 |
| 120 // Contains the alternative players that are not currently in use, i.e. the | 119 // Contains the alternative players that are not currently in use, i.e. the |
| 121 // remote players for videos that are playing locally, and the local players | 120 // remote players for videos that are playing locally, and the local players |
| 122 // for videos that are playing remotely. | 121 // for videos that are playing remotely. |
| 123 ScopedVector<media::MediaPlayerAndroid> alternative_players_; | 122 std::vector<std::unique_ptr<media::MediaPlayerAndroid>> alternative_players_; |
| 124 | 123 |
| 125 std::set<int> players_playing_remotely_; | 124 std::set<int> players_playing_remotely_; |
| 126 std::unordered_map<int, GURL> poster_urls_; | 125 std::unordered_map<int, GURL> poster_urls_; |
| 127 | 126 |
| 128 base::WeakPtrFactory<RemoteMediaPlayerManager> weak_ptr_factory_; | 127 base::WeakPtrFactory<RemoteMediaPlayerManager> weak_ptr_factory_; |
| 129 | 128 |
| 130 DISALLOW_COPY_AND_ASSIGN(RemoteMediaPlayerManager); | 129 DISALLOW_COPY_AND_ASSIGN(RemoteMediaPlayerManager); |
| 131 }; | 130 }; |
| 132 | 131 |
| 133 } // namespace remote_media | 132 } // namespace remote_media |
| 134 | 133 |
| 135 #endif // CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_ | 134 #endif // CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_MANAGER_H_ |
| OLD | NEW |