Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(680)

Unified Diff: content/browser/android/content_video_view.cc

Issue 11442056: Add external surface rendering mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8c720f250815a9c50b1d19272136609eed21191a 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) {
+ 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(),

Powered by Google App Engine
This is Rietveld 408576698