Chromium Code Reviews| 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 2a86830def3b16ce053d09ae46b8506c7e188e13..a9b0a2e90fa761192d6582c19dadea9e05afdf09 100644 |
| --- a/content/browser/android/content_video_view.h |
| +++ b/content/browser/android/content_video_view.h |
| @@ -17,6 +17,7 @@ |
| namespace content { |
| class BrowserMediaPlayerManager; |
| +class ContentViewCoreImpl; |
| // Native mirror of ContentVideoView.java. This class is responsible for |
| // creating the Java video view and pass all the player status change to |
| @@ -31,6 +32,8 @@ class ContentVideoView { |
| const base::android::ScopedJavaLocalRef<jobject>& client, |
| BrowserMediaPlayerManager* manager); |
| + ContentVideoView(BrowserMediaPlayerManager* manager); |
| + |
| ~ContentVideoView(); |
| // To open another video on existing ContentVideoView. |
| @@ -39,8 +42,8 @@ class ContentVideoView { |
| static bool RegisterContentVideoView(JNIEnv* env); |
| static void KeepScreenOn(bool screen_on); |
| - // Return true if there is existing ContentVideoView object. |
| - static bool HasContentVideoView(); |
| + // Return the singleton object or NULL. |
| + static ContentVideoView* GetInstance(); |
| // Getter method called by the Java class to get the media information. |
| int GetVideoWidth(JNIEnv*, jobject obj) const; |
| @@ -55,6 +58,15 @@ class ContentVideoView { |
| // as we are quitting the app. |
| void ExitFullscreen(JNIEnv*, jobject, jboolean release_media_player); |
| + // Supposed to be called when the application paused or stopped. |
| + // Destroys the fullscreen view in a way that it can be recreated |
| + // via ResumeFullscreenIfSuspended. |
| + void SuspendFullscreen(); |
| + |
| + // Supposed to be called when the application switches back to foreground. |
| + // Recreates the fullscreen view if it was suspended via SuspendFullscreen. |
| + void ResumeFullscreenIfSuspended(); |
| + |
| // Media control method called by the Java class. |
| void SeekTo(JNIEnv*, jobject obj, jint msec); |
| void Play(JNIEnv*, jobject obj); |
| @@ -75,6 +87,10 @@ class ContentVideoView { |
| // Return the corresponing ContentVideoView Java object if any. |
| base::android::ScopedJavaLocalRef<jobject> GetJavaObject(JNIEnv* env); |
| + // Creates the corresponding ContentVideoView Java object. |
| + JavaObjectWeakGlobalRef CreateJavaObject( |
| + ContentViewCoreImpl* content_view_core); |
|
qinmin
2013/12/18 02:09:46
no need for the input param, you can get that from
|
| + |
| private: |
| // Destroy the |j_content_video_view_|. If |native_view_destroyed| is true, |
| // no further calls to the native object is allowed. |
| @@ -87,6 +103,12 @@ class ContentVideoView { |
| // Weak reference of corresponding Java object. |
| JavaObjectWeakGlobalRef j_content_video_view_; |
| + enum FullscreenState { |
| + Entered, |
| + Suspend, |
| + Resume |
| + } fullscreen_state_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ContentVideoView); |
| }; |