| Index: content/browser/android/content_video_view.h
|
| diff --git a/content/browser/android/content_video_view.h b/content/browser/android/content_video_view.h
|
| index cb9c0d3f60003d8408d5a36511c86cefad349a8e..cc552f3dce7d1f060756cec8d9562f6ccace71bc 100644
|
| --- a/content/browser/android/content_video_view.h
|
| +++ b/content/browser/android/content_video_view.h
|
| @@ -12,6 +12,8 @@
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "content/public/browser/android/content_view_core.h"
|
| +#include "content/public/browser/android/video_surface_provider.h"
|
| +#include "ui/gfx/geometry/size.h"
|
| #include "ui/gl/android/scoped_java_surface.h"
|
|
|
| namespace content {
|
| @@ -19,35 +21,15 @@ namespace content {
|
| // Native mirror of ContentVideoView.java. This class is responsible for
|
| // creating the Java video view and passing changes in player status to it.
|
| // This class must be used on the UI thread.
|
| -class ContentVideoView {
|
| +class ContentVideoView : public content::VideoSurfaceProvider {
|
| public:
|
| static bool RegisterContentVideoView(JNIEnv* env);
|
|
|
| // Returns the singleton object or NULL.
|
| static ContentVideoView* GetInstance();
|
|
|
| - class Client {
|
| - public:
|
| - Client() {}
|
| - // For receiving notififcations when the SurfaceView surface is created and
|
| - // destroyed. When |surface.IsEmpty()| the surface was destroyed and
|
| - // the client should not hold any references to it once this returns.
|
| - virtual void SetVideoSurface(gl::ScopedJavaSurface surface) = 0;
|
| -
|
| - // Called after the ContentVideoView has been hidden because we're exiting
|
| - // fullscreen.
|
| - virtual void DidExitFullscreen(bool release_media_player) = 0;
|
| -
|
| - protected:
|
| - ~Client() {}
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(Client);
|
| - };
|
| -
|
| - explicit ContentVideoView(Client* client,
|
| - ContentViewCore* content_view_core,
|
| - const base::android::JavaRef<jobject>& embedder,
|
| - const gfx::Size& video_natural_size);
|
| + explicit ContentVideoView(ContentViewCore* content_view_core,
|
| + const base::android::JavaRef<jobject>& embedder);
|
| ~ContentVideoView();
|
|
|
| // To open another video on existing ContentVideoView.
|
| @@ -57,7 +39,12 @@ class ContentVideoView {
|
| void OnMediaPlayerError(int error_type);
|
|
|
| // Update the video size.
|
| - void OnVideoSizeChanged(int width, int height);
|
| + void OnVideoSizeChanged(int width, int height) override;
|
| +
|
| + // Instantiates the Java object and creates the video surface.
|
| + void CreateVideoSurface(VideoSurfaceProvider::Client* client,
|
| + const gfx::Size& video_natural_size) override;
|
| +
|
|
|
| // Exit fullscreen and notify |client_| with |DidExitFullscreen|.
|
| void ExitFullscreen();
|
| @@ -91,12 +78,11 @@ class ContentVideoView {
|
|
|
| private:
|
| // Creates the corresponding ContentVideoView Java object.
|
| - JavaObjectWeakGlobalRef CreateJavaObject(
|
| - ContentViewCore* content_view_core,
|
| - const base::android::JavaRef<jobject>& j_content_video_view_embedder,
|
| - const gfx::Size& video_natural_size);
|
| + JavaObjectWeakGlobalRef CreateJavaObject(const gfx::Size& video_natural_size);
|
|
|
| - Client* client_;
|
| + VideoSurfaceProvider::Client* client_;
|
| + ContentViewCore* cvc_;
|
| + const base::android::JavaRef<jobject>& j_content_video_view_embedder_;
|
|
|
| // Weak reference to corresponding Java object.
|
| JavaObjectWeakGlobalRef j_content_video_view_;
|
|
|