Chromium Code Reviews| Index: content/renderer/media/webmediaplayer_proxy_impl_android.h |
| diff --git a/content/renderer/media/webmediaplayer_proxy_impl_android.h b/content/renderer/media/webmediaplayer_proxy_impl_android.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..38e89cfd41ae9caefc43f67dcd551ea00b1d8dcd |
| --- /dev/null |
| +++ b/content/renderer/media/webmediaplayer_proxy_impl_android.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_ |
| +#define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_ |
| + |
| +#include <map> |
| + |
| +#include "content/public/renderer/render_view_observer.h" |
| +#include "ipc/ipc_channel_proxy.h" |
| +#include "webkit/media/android/webmediaplayer_proxy_android.h" |
| + |
| +namespace webkit_media { |
| +class WebMediaPlayerImplAndroid; |
| +class WebMediaPlayerManagerAndroid; |
| +} |
| + |
| +namespace content { |
| + |
| +// This class manages all the IPC communications between |
| +// WebMediaPlayerImplAndroid and the MediaplayerManagerAndroid in the browser |
| +// process. |
| +class WebMediaPlayerProxyImplAndroid : |
| + public RenderViewObserver, |
|
scherkus (not reviewing)
2012/09/07 13:17:35
initializer list style
class A
: public B,
qinmin
2012/09/07 22:48:27
Done.
|
| + public webkit_media::WebMediaPlayerProxyAndroid { |
| + public: |
| + WebMediaPlayerProxyImplAndroid( |
| + RenderView* render_view, |
| + webkit_media::WebMediaPlayerManagerAndroid* manager); |
| + virtual ~WebMediaPlayerProxyImplAndroid(); |
| + |
| + bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| + |
| + // Methods inherited from WebMediaPlayerProxyAndroid. |
| + virtual void Initialize(int player_id, const std::string& url) OVERRIDE; |
| + virtual void Start(int player_id) OVERRIDE; |
| + virtual void Pause(int player_id) OVERRIDE; |
| + virtual void Seek(int player_id, base::TimeDelta time) OVERRIDE; |
| + virtual void ReleaseResources(int player_id) OVERRIDE; |
| + virtual void DestroyPlayer(int player_id) OVERRIDE; |
| + |
| + private: |
| + webkit_media::WebMediaPlayerImplAndroid* GetWebMediaPlayer(int player_id); |
| + |
| + // Message handlers. |
| + void OnMediaPrepared(int player_id, base::TimeDelta duration); |
| + void OnMediaPlaybackCompleted(int player_id); |
| + void OnMediaBufferingUpdate(int player_id, int percent); |
| + void OnMediaSeekCompleted(int player_id, base::TimeDelta current_time); |
| + void OnMediaError(int player_id, int error); |
| + void OnVideoSizeChanged(int player_id, int width, int height); |
| + void OnTimeUpdate(int player_id, base::TimeDelta current_time); |
| + |
| + webkit_media::WebMediaPlayerManagerAndroid* manager_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerProxyImplAndroid); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_ |