| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "content/public/renderer/render_view_observer.h" |
| 11 #include "ipc/ipc_channel_proxy.h" |
| 12 #include "webkit/media/android/webmediaplayer_proxy_android.h" |
| 13 |
| 14 namespace webkit_media { |
| 15 class WebMediaPlayerImplAndroid; |
| 16 class WebMediaPlayerManagerAndroid; |
| 17 } |
| 18 |
| 19 namespace content { |
| 20 |
| 21 // This class manages all the IPC communications between |
| 22 // WebMediaPlayerImplAndroid and the MediaplayerManagerAndroid in the browser |
| 23 // process. |
| 24 class WebMediaPlayerProxyImplAndroid : |
| 25 public RenderViewObserver, |
| 26 public webkit_media::WebMediaPlayerProxyAndroid { |
| 27 public: |
| 28 WebMediaPlayerProxyImplAndroid( |
| 29 RenderView* render_view, |
| 30 webkit_media::WebMediaPlayerManagerAndroid* manager); |
| 31 virtual ~WebMediaPlayerProxyImplAndroid(); |
| 32 |
| 33 bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 34 |
| 35 // Methods inherited from WebMediaPlayerProxyAndroid. |
| 36 virtual void Initialize(int player_id, const std::string& url) OVERRIDE; |
| 37 virtual void Start(int player_id) OVERRIDE; |
| 38 virtual void Pause(int player_id) OVERRIDE; |
| 39 virtual void Seek(int player_id, base::TimeDelta time) OVERRIDE; |
| 40 virtual void ReleaseResources(int player_id) OVERRIDE; |
| 41 virtual void DestroyPlayer(int player_id) OVERRIDE; |
| 42 |
| 43 private: |
| 44 webkit_media::WebMediaPlayerImplAndroid* GetWebMediaPlayer(int player_id); |
| 45 |
| 46 // Message handlers. |
| 47 void OnMediaPrepared(int player_id, base::TimeDelta duration); |
| 48 void OnMediaPlaybackCompleted(int player_id); |
| 49 void OnMediaBufferingUpdate(int player_id, int percent); |
| 50 void OnMediaSeekCompleted(int player_id, base::TimeDelta current_time); |
| 51 void OnMediaError(int player_id, int error); |
| 52 void OnVideoSizeChanged(int player_id, int width, int height); |
| 53 void OnTimeUpdate(int player_id, base::TimeDelta current_time); |
| 54 |
| 55 webkit_media::WebMediaPlayerManagerAndroid* manager_; |
| 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerProxyImplAndroid); |
| 58 }; |
| 59 |
| 60 } // namespace content |
| 61 |
| 62 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_ |
| OLD | NEW |