Upstream version 6.35.131.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / android / core / src / org / xwalk / core / XWalkContentVideoViewClient.java
index a2555e2..ac3f96e 100644 (file)
@@ -9,20 +9,29 @@ import android.content.Context;
 import android.view.View;
 import android.view.WindowManager;
 
+import org.chromium.base.CommandLine;
 import org.chromium.content.browser.ContentVideoViewClient;
+import org.chromium.content.common.ContentSwitches;
 import org.xwalk.core.XWalkWebChromeClient.CustomViewCallback;
 
 class XWalkContentVideoViewClient implements ContentVideoViewClient {
     private XWalkContentsClient mContentsClient;
     private Activity mActivity;
+    private XWalkView mView;
 
-    public XWalkContentVideoViewClient(XWalkContentsClient client, Activity activity) {
+    public XWalkContentVideoViewClient(XWalkContentsClient client, Activity activity, XWalkView view) {
         mContentsClient = client;
         mActivity = activity;
+        mView = view;
     }
 
     @Override
     public void onShowCustomView(View view) {
+        if (!CommandLine.getInstance().hasSwitch(
+                ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
+            mView.setOverlayVideoMode(true);
+        }
+
         CustomViewCallback cb = new CustomViewCallback() {
             @Override
             public void onCustomViewHidden() {
@@ -33,6 +42,10 @@ class XWalkContentVideoViewClient implements ContentVideoViewClient {
 
     @Override
     public void onDestroyContentVideoView() {
+        if (!CommandLine.getInstance().hasSwitch(
+                ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
+            mView.setOverlayVideoMode(false);
+        }
         mContentsClient.onHideCustomView();
     }