| 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_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_BRIDGE_H_ | 
| 6 #define CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_BRIDGE_H_ | 6 #define CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_BRIDGE_H_ | 
| 7 | 7 | 
| 8 #include <jni.h> | 8 #include <jni.h> | 
| 9 #include <vector> | 9 #include <vector> | 
| 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 "base/timer/timer.h" | 13 #include "base/timer/timer.h" | 
| 14 #include "media/base/android/media_player_bridge.h" | 14 #include "media/base/android/media_player_bridge.h" | 
| 15 | 15 | 
| 16 class SkBitmap; | 16 class SkBitmap; | 
| 17 | 17 | 
| 18 // This is the version of MediaPlayerBridge that handles the remote media | 18 // This is the version of MediaPlayerBridge that handles the remote media | 
| 19 // playback. | 19 // playback. | 
| 20 | 20 | 
| 21 namespace remote_media { | 21 namespace remote_media { | 
| 22 | 22 | 
| 23 class RemoteMediaPlayerManager; | 23 class RemoteMediaPlayerManager; | 
| 24 | 24 | 
| 25 class RemoteMediaPlayerBridge : public media::MediaPlayerAndroid { | 25 class RemoteMediaPlayerBridge : public media::MediaPlayerAndroid { | 
| 26  public: | 26  public: | 
| 27   RemoteMediaPlayerBridge(int player_id, | 27   RemoteMediaPlayerBridge(int player_id, | 
| 28                           const std::string& user_agent, | 28                           const std::string& user_agent, | 
| 29                           bool hide_url_log, |  | 
| 30                           RemoteMediaPlayerManager* manager); | 29                           RemoteMediaPlayerManager* manager); | 
| 31   ~RemoteMediaPlayerBridge() override; | 30   ~RemoteMediaPlayerBridge() override; | 
| 32 | 31 | 
| 33   static bool RegisterRemoteMediaPlayerBridge(JNIEnv* env); | 32   static bool RegisterRemoteMediaPlayerBridge(JNIEnv* env); | 
| 34 | 33 | 
| 35   // Initialize this object. | 34   // Initialize this object. | 
| 36   virtual void Initialize(); | 35   virtual void Initialize(); | 
| 37 | 36 | 
| 38   // MediaPlayerAndroid implementation. | 37   // MediaPlayerAndroid implementation. | 
| 39   void SetVideoSurface(gfx::ScopedJavaSurface surface) override; | 38   void SetVideoSurface(gfx::ScopedJavaSurface surface) override; | 
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 120   // are retrieved. | 119   // are retrieved. | 
| 121   void OnCookiesRetrieved(const std::string& cookies); | 120   void OnCookiesRetrieved(const std::string& cookies); | 
| 122 | 121 | 
| 123   media::MediaPlayerAndroid* GetLocalPlayer(); | 122   media::MediaPlayerAndroid* GetLocalPlayer(); | 
| 124 | 123 | 
| 125   int width_; | 124   int width_; | 
| 126   int height_; | 125   int height_; | 
| 127   base::RepeatingTimer time_update_timer_; | 126   base::RepeatingTimer time_update_timer_; | 
| 128   base::TimeDelta duration_; | 127   base::TimeDelta duration_; | 
| 129 | 128 | 
| 130   // Hide url log from media player. |  | 
| 131   bool hide_url_log_; |  | 
| 132 |  | 
| 133   // Url for playback. | 129   // Url for playback. | 
| 134   GURL url_; | 130   GURL url_; | 
| 135 | 131 | 
| 136   // First party url for cookies. | 132   // First party url for cookies. | 
| 137   GURL first_party_for_cookies_; | 133   GURL first_party_for_cookies_; | 
| 138 | 134 | 
| 139   // Cookies for |url_|. | 135   // Cookies for |url_|. | 
| 140   std::string cookies_; | 136   std::string cookies_; | 
| 141 | 137 | 
| 142   // User agent string to be used for media player. | 138   // User agent string to be used for media player. | 
| 143   const std::string user_agent_; | 139   const std::string user_agent_; | 
| 144 | 140 | 
| 145   base::android::ScopedJavaGlobalRef<jobject> java_bridge_; | 141   base::android::ScopedJavaGlobalRef<jobject> java_bridge_; | 
| 146   std::unique_ptr<std::string> casting_message_; | 142   std::unique_ptr<std::string> casting_message_; | 
| 147 | 143 | 
| 148   // NOTE: Weak pointers must be invalidated before all other member variables. | 144   // NOTE: Weak pointers must be invalidated before all other member variables. | 
| 149   base::WeakPtrFactory<RemoteMediaPlayerBridge> weak_factory_; | 145   base::WeakPtrFactory<RemoteMediaPlayerBridge> weak_factory_; | 
| 150 | 146 | 
| 151   DISALLOW_COPY_AND_ASSIGN(RemoteMediaPlayerBridge); | 147   DISALLOW_COPY_AND_ASSIGN(RemoteMediaPlayerBridge); | 
| 152 }; | 148 }; | 
| 153 | 149 | 
| 154 } // namespace remote_media | 150 } // namespace remote_media | 
| 155 | 151 | 
| 156 #endif  // CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_BRIDGE_H_ | 152 #endif  // CHROME_BROWSER_MEDIA_ANDROID_REMOTE_REMOTE_MEDIA_PLAYER_BRIDGE_H_ | 
| OLD | NEW | 
|---|