| 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 CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ | 6 #define CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "content/public/renderer/render_frame_observer.h" | 13 #include "content/public/renderer/render_frame_observer.h" |
| 14 #include "media/base/android/media_player_android.h" | 14 #include "media/base/android/media_player_android.h" |
| 15 #include "media/blink/renderer_media_player_interface.h" | 15 #include "media/blink/renderer_media_player_interface.h" |
| 16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 17 | 17 |
| 18 namespace blink { |
| 19 enum class WebRemotePlaybackAvailability; |
| 20 } |
| 21 |
| 18 namespace content { | 22 namespace content { |
| 19 class WebMediaPlayerAndroid; | 23 class WebMediaPlayerAndroid; |
| 20 | 24 |
| 21 // Class for managing all the WebMediaPlayerAndroid objects in the same | 25 // Class for managing all the WebMediaPlayerAndroid objects in the same |
| 22 // RenderFrame. | 26 // RenderFrame. |
| 23 class RendererMediaPlayerManager : | 27 class RendererMediaPlayerManager : |
| 24 public RenderFrameObserver, | 28 public RenderFrameObserver, |
| 25 public media::RendererMediaPlayerManagerInterface { | 29 public media::RendererMediaPlayerManagerInterface { |
| 26 public: | 30 public: |
| 27 // Constructs a RendererMediaPlayerManager object for the |render_frame|. | 31 // Constructs a RendererMediaPlayerManager object for the |render_frame|. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void OnMediaPlayerReleased(int player_id); | 111 void OnMediaPlayerReleased(int player_id); |
| 108 void OnConnectedToRemoteDevice(int player_id, | 112 void OnConnectedToRemoteDevice(int player_id, |
| 109 const std::string& remote_playback_message); | 113 const std::string& remote_playback_message); |
| 110 void OnDisconnectedFromRemoteDevice(int player_id); | 114 void OnDisconnectedFromRemoteDevice(int player_id); |
| 111 void OnCancelledRemotePlaybackRequest(int player_id); | 115 void OnCancelledRemotePlaybackRequest(int player_id); |
| 112 void OnRemotePlaybackStarted(int player_id); | 116 void OnRemotePlaybackStarted(int player_id); |
| 113 void OnDidExitFullscreen(int player_id); | 117 void OnDidExitFullscreen(int player_id); |
| 114 void OnDidEnterFullscreen(int player_id); | 118 void OnDidEnterFullscreen(int player_id); |
| 115 void OnPlayerPlay(int player_id); | 119 void OnPlayerPlay(int player_id); |
| 116 void OnPlayerPause(int player_id); | 120 void OnPlayerPause(int player_id); |
| 117 void OnRemoteRouteAvailabilityChanged(int player_id, bool routes_available); | 121 void OnRemoteRouteAvailabilityChanged( |
| 122 int player_id, blink::WebRemotePlaybackAvailability availability); |
| 118 | 123 |
| 119 // Info for all available WebMediaPlayerAndroid on a page; kept so that | 124 // Info for all available WebMediaPlayerAndroid on a page; kept so that |
| 120 // we can enumerate them to send updates about tab focus and visibility. | 125 // we can enumerate them to send updates about tab focus and visibility. |
| 121 std::map<int, media::RendererMediaPlayerInterface*> media_players_; | 126 std::map<int, media::RendererMediaPlayerInterface*> media_players_; |
| 122 | 127 |
| 123 int next_media_player_id_; | 128 int next_media_player_id_; |
| 124 | 129 |
| 125 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); | 130 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); |
| 126 }; | 131 }; |
| 127 | 132 |
| 128 } // namespace content | 133 } // namespace content |
| 129 | 134 |
| 130 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ | 135 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ |
| OLD | NEW |