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

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

Issue 2353063005: Refactor ContentViewClient (1/6) (Closed)
Patch Set: cast to activity Created 4 years, 3 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
« no previous file with comments | « content/browser/android/content_video_view.h ('k') | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9b919e8bf31a365e36f700aef1e5741e0c5d6719..4df61ff7e6f0daac808093305d4899180b3eaa42 100644
--- a/content/browser/android/content_video_view.cc
+++ b/content/browser/android/content_video_view.cc
@@ -16,6 +16,7 @@
using base::android::AttachCurrentThread;
using base::android::CheckException;
using base::android::JavaParamRef;
+using base::android::JavaRef;
using base::android::ScopedJavaGlobalRef;
using base::android::ScopedJavaLocalRef;
using base::UserMetricsAction;
@@ -49,11 +50,12 @@ ContentVideoView* ContentVideoView::GetInstance() {
ContentVideoView::ContentVideoView(Client* client,
ContentViewCore* content_view_core,
+ const JavaRef<jobject>& video_embedder,
const gfx::Size& video_natural_size)
: client_(client), weak_factory_(this) {
DCHECK(!g_content_video_view);
j_content_video_view_ =
- CreateJavaObject(content_view_core, video_natural_size);
+ CreateJavaObject(content_view_core, video_embedder, video_natural_size);
g_content_video_view = this;
}
@@ -162,16 +164,19 @@ void ContentVideoView::RecordExitFullscreenPlayback(
JavaObjectWeakGlobalRef ContentVideoView::CreateJavaObject(
ContentViewCore* content_view_core,
+ const JavaRef<jobject>& j_content_video_view_embedder,
const gfx::Size& video_natural_size) {
JNIEnv* env = AttachCurrentThread();
base::android::ScopedJavaLocalRef<jobject> j_content_view_core =
content_view_core->GetJavaObject();
+
if (j_content_view_core.is_null())
return JavaObjectWeakGlobalRef(env, nullptr);
return JavaObjectWeakGlobalRef(
env, Java_ContentVideoView_createContentVideoView(
- env, j_content_view_core, reinterpret_cast<intptr_t>(this),
+ env, j_content_view_core, j_content_video_view_embedder,
+ reinterpret_cast<intptr_t>(this),
video_natural_size.width(), video_natural_size.height())
.obj());
}
« no previous file with comments | « content/browser/android/content_video_view.h ('k') | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698