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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwContentsClient.java

Issue 52463004: Block media loading when AwSettings.setBlockNetworkLoads is true. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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/java/src/org/chromium/android_webview/AwContentsClient.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
index 41989dd3434ba116d183e4b38d7c57f656fc5252..173b63ad79ba5dd439cf5752667a41edd859b21c 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
@@ -55,6 +55,8 @@ public abstract class AwContentsClient {
private static final int INVALID_COLOR = 0;
+ private AwSettings mSettings;
joth 2013/11/01 19:37:33 probably cleaner to push this in as a member of th
+
public AwContentsClient() {
this(Looper.myLooper());
}
@@ -135,13 +137,22 @@ public abstract class AwContentsClient {
final public ContentVideoViewClient getContentVideoViewClient() {
return new AwContentVideoViewClient();
}
+
+ @Override
+ public boolean shouldBlockMediaRequest(String url) {
+ if (mSettings != null)
qinmin 2013/10/31 16:41:26 nit: I thought java coding style needs {} for if s
Ben Murdoch 2013/10/31 17:26:56 nit: could make this one line return mSettings ==
+ return mSettings.getBlockNetworkLoads();
+ else
+ return true;
mkosiba (inactive) 2013/10/31 17:05:14 why is blocking the default? Did WebViewClassic be
joth 2013/11/01 19:37:33 I think the choice is arbitrary - it's not meaning
+ }
}
- final void installWebContentsObserver(ContentViewCore contentViewCore) {
+ final void installWebContentsObserver(ContentViewCore contentViewCore, AwSettings settings) {
mkosiba (inactive) 2013/10/31 17:05:14 method doesn't do what it says anymore. Maybe add
if (mWebContentsObserver != null) {
mWebContentsObserver.detachFromWebContents();
}
mWebContentsObserver = new AwWebContentsObserver(contentViewCore);
+ mSettings = settings;
}
private class AwContentVideoViewClient implements ContentVideoViewClient {

Powered by Google App Engine
This is Rietveld 408576698