Index: content/browser/android/content_video_view.cc |
diff --git a/content/browser/android/content_video_view.cc b/content/browser/android/content_video_view.cc |
index c00ca4af3b198b782f29ff5f2be0cd620da4fba2..b3caa7e0730fe9f30c5390f1098e9c31e464287d 100644 |
--- a/content/browser/android/content_video_view.cc |
+++ b/content/browser/android/content_video_view.cc |
@@ -25,18 +25,22 @@ bool ContentVideoView::RegisterContentVideoView(JNIEnv* env) { |
} |
ContentVideoView::ContentVideoView(MediaPlayerManagerAndroid* manager) |
- : manager_(manager) { |
+ : manager_(manager), personality_(PERSONALITY_FULL_SCREEN) { |
} |
ContentVideoView::~ContentVideoView() { |
DestroyContentVideoView(); |
} |
-void ContentVideoView::CreateContentVideoView() { |
+void ContentVideoView::CreateContentVideoView(int personality) { |
+ if (!j_content_video_view_.is_null() && personality_ != personality) { |
qinmin
2012/12/17 19:34:06
is this going to support both playing an embedded
wonsik2
2013/02/14 14:56:38
Do you think having a separate class/SurfaceView f
|
+ DestroyContentVideoView(); |
+ } |
+ personality_ = personality; |
if (j_content_video_view_.is_null()) { |
JNIEnv* env = AttachCurrentThread(); |
j_content_video_view_.Reset(Java_ContentVideoView_createContentVideoView( |
- env, reinterpret_cast<jint>(this))); |
+ env, reinterpret_cast<jint>(this), static_cast<jint>(personality))); |
} else { |
// Just ask video view to reopen the video. |
Java_ContentVideoView_openVideo(AttachCurrentThread(), |
@@ -83,6 +87,10 @@ void ContentVideoView::OnPlaybackComplete() { |
} |
} |
+int ContentVideoView::getPersonality() { |
+ return personality_; |
+} |
+ |
void ContentVideoView::UpdateMediaMetadata() { |
if (!j_content_video_view_.is_null()) |
UpdateMediaMetadata(AttachCurrentThread(), j_content_video_view_.obj()); |