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

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: disable failed test Created 7 years, 1 month 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 7f72b2d617d4eef246ed1c6f2fdeb9f1e4bdde22..3baa7675715e13876fc60a1f6649bed488420b86 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
@@ -4,29 +4,19 @@
package org.chromium.android_webview;
-import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.graphics.Picture;
-import android.graphics.Rect;
-import android.graphics.RectF;
import android.net.http.SslError;
-import android.os.Handler;
import android.os.Looper;
import android.os.Message;
-import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.ConsoleMessage;
import android.webkit.GeolocationPermissions;
-import android.webkit.SslErrorHandler;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
-import org.chromium.content.browser.ContentVideoView;
-import org.chromium.content.browser.ContentVideoViewClient;
-import org.chromium.content.browser.ContentVideoViewControls;
-import org.chromium.content.browser.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.WebContentsObserverAndroid;
import org.chromium.net.NetError;
@@ -47,8 +37,6 @@ public abstract class AwContentsClient {
private AwWebContentsObserver mWebContentsObserver;
- private AwContentViewClient mContentViewClient = new AwContentViewClient();
-
// Last background color reported from the renderer. Holds the sentinal value INVALID_COLOR
// if not valid.
private int mCachedRendererBackgroundColor = INVALID_COLOR;
@@ -101,36 +89,6 @@ public abstract class AwContentsClient {
}
- private class AwContentViewClient extends ContentViewClient {
- @Override
- public void onBackgroundColorChanged(int color) {
- // Avoid storing the sentinal INVALID_COLOR (note that both 0 and 1 are both
- // fully transparent so this transpose makes no visible difference).
- mCachedRendererBackgroundColor = color == INVALID_COLOR ? 1 : color;
- }
-
- @Override
- public void onStartContentIntent(Context context, String contentUrl) {
- // Callback when detecting a click on a content link.
- AwContentsClient.this.shouldOverrideUrlLoading(contentUrl);
- }
-
- @Override
- public void onUpdateTitle(String title) {
- AwContentsClient.this.onReceivedTitle(title);
- }
-
- @Override
- public boolean shouldOverrideKeyEvent(KeyEvent event) {
- return AwContentsClient.this.shouldOverrideKeyEvent(event);
- }
-
- @Override
- final public ContentVideoViewClient getContentVideoViewClient() {
- return new AwContentVideoViewClient();
- }
- }
-
final void installWebContentsObserver(ContentViewCore contentViewCore) {
if (mWebContentsObserver != null) {
mWebContentsObserver.detachFromWebContents();
@@ -138,44 +96,10 @@ public abstract class AwContentsClient {
mWebContentsObserver = new AwWebContentsObserver(contentViewCore);
}
- private class AwContentVideoViewClient implements ContentVideoViewClient {
- @Override
- public void onShowCustomView(View view) {
- WebChromeClient.CustomViewCallback cb = new WebChromeClient.CustomViewCallback() {
- @Override
- public void onCustomViewHidden() {
- ContentVideoView contentVideoView = ContentVideoView.getContentVideoView();
- if (contentVideoView != null)
- contentVideoView.exitFullscreen(false);
- }
- };
- AwContentsClient.this.onShowCustomView(view, cb);
- }
-
- @Override
- public void onDestroyContentVideoView() {
- AwContentsClient.this.onHideCustomView();
- }
-
- @Override
- public View getVideoLoadingProgressView() {
- return AwContentsClient.this.getVideoLoadingProgressView();
- }
-
- @Override
- public ContentVideoViewControls createControls() {
- return null;
- }
- }
-
final AwContentsClientCallbackHelper getCallbackHelper() {
return mCallbackHelper;
}
- final ContentViewClient getContentViewClient() {
- return mContentViewClient;
- }
-
final int getCachedRendererBackgroundColor() {
assert isCachedRendererBackgroundColorValid();
return mCachedRendererBackgroundColor;
@@ -185,6 +109,12 @@ public abstract class AwContentsClient {
return mCachedRendererBackgroundColor != INVALID_COLOR;
}
+ final void onBackgroundColorChanged(int color) {
+ // Avoid storing the sentinal INVALID_COLOR (note that both 0 and 1 are both
+ // fully transparent so this transpose makes no visible difference).
+ mCachedRendererBackgroundColor = color == INVALID_COLOR ? 1 : color;
+ }
+
//--------------------------------------------------------------------------------------------
// WebView specific methods that map directly to WebViewClient / WebChromeClient
//--------------------------------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698