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 a9aced4da2ba31d96cb8d802bba0c94ba3416139..9fc09f0bc4d5c9991e2b15f08a0abfdaf315321e 100644 |
--- a/content/browser/android/content_video_view.cc |
+++ b/content/browser/android/content_video_view.cc |
@@ -24,18 +24,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) { |
+ 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(), |
@@ -82,6 +86,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()); |