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..7e05969724c31a984358d880c8b7463e8a2ea7e6 100644 |
| --- a/content/browser/android/content_video_view.h |
| +++ b/content/browser/android/content_video_view.h |
| @@ -31,6 +31,8 @@ class ContentVideoView { |
| const base::android::ScopedJavaLocalRef<jobject>& client, |
| BrowserMediaPlayerManager* manager); |
| + ContentVideoView(BrowserMediaPlayerManager* manager); |
| + |
| ~ContentVideoView(); |
| // To open another video on existing ContentVideoView. |
| @@ -39,8 +41,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 +57,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 +86,9 @@ 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(); |
|
Ted C
2013/12/26 17:54:06
why does this need to be public?
kbalazs
2013/12/26 20:09:57
It doesn't :)
|
| + |
| private: |
| // Destroy the |j_content_video_view_|. If |native_view_destroyed| is true, |
| // no further calls to the native object is allowed. |
| @@ -87,6 +101,12 @@ class ContentVideoView { |
| // Weak reference of corresponding Java object. |
| JavaObjectWeakGlobalRef j_content_video_view_; |
| + enum FullscreenState { |
| + ENTERED, |
| + SUSPENDED, |
| + RESUME |
| + } fullscreen_state_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ContentVideoView); |
| }; |