Chromium Code Reviews| 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 { |