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

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

Issue 13669003: Refactoring ContentVideoViewContextDelegate.java (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 3862b6d239ad2774b87943987b35d2e3c4b46686..5fd95e0cec24695b2199c023bfd338a60eff4673 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
@@ -4,6 +4,7 @@
package org.chromium.android_webview;
+import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.graphics.Picture;
@@ -22,6 +23,8 @@ 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.ContentViewClient;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content.browser.WebContentsObserverAndroid;
@@ -197,6 +200,31 @@ public abstract class AwContentsClient extends ContentViewClient {
}
+ 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();
+ }
+ }
+
void installWebContentsObserver(ContentViewCore contentViewCore) {
if (mWebContentsObserver != null) {
mWebContentsObserver.detachFromWebContents();
@@ -333,4 +361,9 @@ public abstract class AwContentsClient extends ContentViewClient {
@Override
final public void onContextualActionBarHidden() {
}
+
+ @Override
+ final public ContentVideoViewClient getContentVideoViewClient() {
+ return new AwContentVideoViewClient();
+ }
joth 2013/05/15 22:38:57 (note you'll need to move this to the inner Conten
michaelbai 2013/05/22 18:08:39 Thanks On 2013/05/15 22:38:57, joth wrote:
}

Powered by Google App Engine
This is Rietveld 408576698