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

Unified Diff: android_webview/native/aw_web_contents_delegate.cc

Issue 2353063005: Refactor ContentViewClient (1/6) (Closed)
Patch Set: fix tests 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
Index: android_webview/native/aw_web_contents_delegate.cc
diff --git a/android_webview/native/aw_web_contents_delegate.cc b/android_webview/native/aw_web_contents_delegate.cc
index a8f04a29358710e33f92d3eb727a0c4e13c6e7cc..d7732d7dbe98fcf2549f7cbe084f79a3e04a2ea0 100644
--- a/android_webview/native/aw_web_contents_delegate.cc
+++ b/android_webview/native/aw_web_contents_delegate.cc
@@ -245,6 +245,25 @@ void AwWebContentsDelegate::RequestMediaAccessPermission(
new MediaAccessPermissionRequest(request, callback)));
}
+ScopedJavaLocalRef<jobject>
+AwWebContentsDelegate::GetContentVideoViewEmbedder() {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
+ if (obj.is_null())
+ return ScopedJavaLocalRef<jobject>();
+
+ return Java_AwWebContentsDelegate_getContentVideoViewEmbedder(env, obj);
+}
+
+bool AwWebContentsDelegate::ShouldBlockMediaRequest(const GURL& url) {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
+ if (obj.is_null())
+ return false;
+ ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec());
+ return Java_AwWebContentsDelegate_shouldBlockMediaRequest(env, obj, j_url);
+}
+
void AwWebContentsDelegate::EnterFullscreenModeForTab(
content::WebContents* web_contents, const GURL& origin) {
WebContentsDelegateAndroid::EnterFullscreenModeForTab(web_contents, origin);

Powered by Google App Engine
This is Rietveld 408576698