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 deb5ffc7f11c91edb3a226ab7cf8395c49fec9de..c420fe930dc357c68db9e11c74870b80ca68814a 100644 |
--- a/content/browser/android/content_video_view.h |
+++ b/content/browser/android/content_video_view.h |
@@ -7,6 +7,7 @@ |
#include <jni.h> |
+#include "base/android/jni_helper.h" |
#include "base/android/scoped_java_ref.h" |
#include "base/basictypes.h" |
#include "base/memory/ref_counted.h" |
@@ -25,9 +26,16 @@ class ContentVideoView { |
public: |
// Construct a ContentVideoView object. The |manager| will handle all the |
// playback controls from the Java class. |
- explicit ContentVideoView(MediaPlayerManagerAndroid* manager); |
+ ContentVideoView( |
+ const base::android::ScopedJavaLocalRef<jobject>& context, |
+ const base::android::ScopedJavaLocalRef<jobject>& client, |
+ MediaPlayerManagerAndroid* manager); |
+ |
~ContentVideoView(); |
+ // To open another video on existing ContentVideoView. |
+ void OpenVideo(); |
+ |
static bool RegisterContentVideoView(JNIEnv* env); |
// Getter method called by the Java class to get the media information. |
@@ -38,10 +46,6 @@ class ContentVideoView { |
bool IsPlaying(JNIEnv*, jobject obj); |
void UpdateMediaMetadata(JNIEnv*, jobject obj); |
- // Method to create and destroy the Java view. |
- void DestroyContentVideoView(); |
- void CreateContentVideoView(); |
- |
// Called when the Java fullscreen view is destroyed. If |
// |release_media_player| is true, |manager_| needs to release the player |
// as we are quitting the app. |
@@ -62,14 +66,18 @@ class ContentVideoView { |
void OnVideoSizeChanged(int width, int height); |
void OnBufferingUpdate(int percent); |
void OnPlaybackComplete(); |
+ void OnExitFullscreen(); |
+ |
+ // Return the corresponing ContentVideoView Java object if any. |
+ base::android::ScopedJavaLocalRef<jobject> GetJavaObject(JNIEnv* env); |
private: |
// Object that manages the fullscreen media player. It is responsible for |
// handling all the playback controls. |
MediaPlayerManagerAndroid* manager_; |
- // Reference to the Java object. |
- base::android::ScopedJavaGlobalRef<jobject> j_content_video_view_; |
+ // Weak reference of corresponding Java object. |
+ scoped_ptr<JavaObjectWeakGlobalRef> j_content_video_view_; |
joth
2013/05/15 22:38:57
no need for scoped_ptr, just have the JavaObjectWe
michaelbai
2013/05/22 18:08:39
Done.
|
DISALLOW_COPY_AND_ASSIGN(ContentVideoView); |
}; |