+ return mAwSettings != null
+ ? mAwSettings.getBlockNetworkLoads() && URLUtil.isNetworkUrl(url) : true;
+ }
+
+ @Override
+ public void enterFullscreenVideo(View videoView) {
+ if (mCustomView == null) {
+ // enterFullscreenVideo will only be called after enterFullscreen, but
+ // in this case exitFullscreen has been invoked in between them.
+ // TODO(igsolla): Fix http://crbug/425926 and replace with assert.
+ return;
+ }
+ mCustomView.addView(videoView, 0);
+ }
+
+ @Override
+ public void exitFullscreenVideo() {
+ // Intentional no-op
+ }
+
+ @Override
+ public View getVideoLoadingProgressView() {
+ return mAwContentsClient.getVideoLoadingProgressView();
+ }
+
+ /**
+ * Called to show the web contents in fullscreen mode.
+ *
+ * <p>If entering fullscreen on a video element the web contents will contain just
+ * the html5 video controls. {@link #enterFullscreenVideo(View)} will be called later
+ * once the ContentVideoView, which contains the hardware accelerated fullscreen video,
+ * is ready to be shown.
+ */
+ public void enterFullscreen() {
+ if (mAwContents.isFullScreen()) {
+ return;
+ }
+ View fullscreenView = mAwContents.enterFullScreen();
+ if (fullscreenView == null) {
+ return;
+ }
+ WebChromeClient.CustomViewCallback cb = new WebChromeClient.CustomViewCallback() {
+ @Override
+ public void onCustomViewHidden() {
+ mAwContents.requestExitFullscreen();
+ }
+ };
+ mCustomView = new FrameLayout(mContext);
+ mCustomView.addView(fullscreenView);
+ mAwContentsClient.onShowCustomView(mCustomView, cb);
+ }
+
+ /**
+ * Called to show the web contents in embedded mode.
+ */
+ public void exitFullscreen() {
+ if (mCustomView != null) {
+ mAwContents.exitFullScreen();
+ mAwContentsClient.onHideCustomView();
+ mCustomView = null;
+ }