1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 package org.xwalk.core.internal;
7 import android.app.Activity;
8 import android.content.Context;
9 import android.view.View;
10 import android.view.WindowManager;
12 import org.chromium.base.CommandLine;
13 import org.chromium.content.browser.ContentVideoViewClient;
14 import org.chromium.content.common.ContentSwitches;
15 import org.xwalk.core.internal.XWalkWebChromeClient.CustomViewCallback;
17 class XWalkContentVideoViewClient implements ContentVideoViewClient {
18 private XWalkContentsClient mContentsClient;
19 private Activity mActivity;
20 private XWalkViewInternal mView;
22 public XWalkContentVideoViewClient(XWalkContentsClient client, Activity activity, XWalkViewInternal view) {
23 mContentsClient = client;
29 public boolean onShowCustomView(View view) {
30 if (!CommandLine.getInstance().hasSwitch(
31 ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
32 mView.setOverlayVideoMode(true);
35 CustomViewCallback cb = new CustomViewCallback() {
37 public void onCustomViewHidden() {
40 mContentsClient.onShowCustomView(view, cb);
45 public void onDestroyContentVideoView() {
46 if (!CommandLine.getInstance().hasSwitch(
47 ContentSwitches.DISABLE_OVERLAY_FULLSCREEN_VIDEO_SUBTITLE)) {
48 mView.setOverlayVideoMode(false);
50 mContentsClient.onHideCustomView();
54 public View getVideoLoadingProgressView() {
55 return mContentsClient.getVideoLoadingProgressView();