| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.android_webview; | 5 package org.chromium.android_webview; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.view.KeyEvent; | 8 import android.view.KeyEvent; |
| 9 import android.view.View; | 9 import android.view.View; |
| 10 import android.webkit.URLUtil; | 10 import android.webkit.URLUtil; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 | 60 |
| 61 @Override | 61 @Override |
| 62 public boolean shouldBlockMediaRequest(String url) { | 62 public boolean shouldBlockMediaRequest(String url) { |
| 63 return mAwSettings != null | 63 return mAwSettings != null |
| 64 ? mAwSettings.getBlockNetworkLoads() && URLUtil.isNetworkUrl(url
) : true; | 64 ? mAwSettings.getBlockNetworkLoads() && URLUtil.isNetworkUrl(url
) : true; |
| 65 } | 65 } |
| 66 | 66 |
| 67 @Override | 67 @Override |
| 68 public void enterFullscreenVideo(View videoView) { | 68 public void enterFullscreenVideo(View videoView) { |
| 69 // enterFullscreenVideo will only be called after enterFullscreen. | 69 if (mCustomView == null) { |
| 70 assert mCustomView != null; | 70 // enterFullscreenVideo will only be called after enterFullscreen, b
ut |
| 71 // in this case exitFullscreen has been invoked in between them. |
| 72 // TODO(igsolla): Fix http://crbug/425926 and replace with assert. |
| 73 return; |
| 74 } |
| 71 mCustomView.addView(videoView, 0); | 75 mCustomView.addView(videoView, 0); |
| 72 } | 76 } |
| 73 | 77 |
| 74 @Override | 78 @Override |
| 75 public void exitFullscreenVideo() { | 79 public void exitFullscreenVideo() { |
| 76 // Intentional no-op | 80 // Intentional no-op |
| 77 } | 81 } |
| 78 | 82 |
| 79 @Override | 83 @Override |
| 80 public View getVideoLoadingProgressView() { | 84 public View getVideoLoadingProgressView() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 * Called to show the web contents in embedded mode. | 116 * Called to show the web contents in embedded mode. |
| 113 */ | 117 */ |
| 114 public void exitFullscreen() { | 118 public void exitFullscreen() { |
| 115 if (mCustomView != null) { | 119 if (mCustomView != null) { |
| 116 mAwContents.exitFullScreen(); | 120 mAwContents.exitFullScreen(); |
| 117 mAwContentsClient.onHideCustomView(); | 121 mAwContentsClient.onHideCustomView(); |
| 118 mCustomView = null; | 122 mCustomView = null; |
| 119 } | 123 } |
| 120 } | 124 } |
| 121 } | 125 } |
| OLD | NEW |