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

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: Separated GLRenderer change out; refined messaging scheme. Created 7 years, 10 months 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 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());
« no previous file with comments | « content/browser/android/content_video_view.h ('k') | content/browser/android/media_player_manager_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698