Upstream version 7.35.139.0
[platform/framework/web/crosswalk.git] / src / content / public / android / java / src / org / chromium / content / browser / ContentVideoView.java
index 0fd5e71..557d63e 100644 (file)
@@ -148,7 +148,10 @@ public class ContentVideoView extends FrameLayout
         mVideoSurfaceView = new VideoSurfaceView(context);
         showContentVideoView();
         setVisibility(View.VISIBLE);
-        mClient.onShowCustomView(this);
+    }
+
+    protected ContentVideoViewClient getContentVideoViewClient() {
+        return mClient;
     }
 
     private void initResources(Context context) {
@@ -368,11 +371,17 @@ public class ContentVideoView extends FrameLayout
             Context context, long nativeContentVideoView, ContentVideoViewClient client,
             boolean legacy) {
         ThreadUtils.assertOnUiThread();
+        ContentVideoView videoView = null;
         if (legacy) {
-            return new ContentVideoViewLegacy(context, nativeContentVideoView, client);
+            videoView = new ContentVideoViewLegacy(context, nativeContentVideoView, client);
         } else {
-            return new ContentVideoView(context, nativeContentVideoView, client);
+            videoView = new ContentVideoView(context, nativeContentVideoView, client);
+        }
+
+        if (videoView.getContentVideoViewClient().onShowCustomView(videoView)) {
+            return videoView;
         }
+        return null;
     }
 
     public void removeSurfaceView() {