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.ContentVideoView;
14 import org.chromium.content.browser.ContentVideoViewClient;
15 import org.chromium.content.common.ContentSwitches;
16 import org.xwalk.core.internal.XWalkWebChromeClient.CustomViewCallback;
18 class XWalkContentVideoViewClient implements ContentVideoViewClient {
19 private XWalkContentsClient mContentsClient;
20 private Activity mActivity;
21 private XWalkViewInternal mView;
23 public XWalkContentVideoViewClient(XWalkContentsClient client, Activity activity, XWalkViewInternal view) {
24 mContentsClient = client;
30 public void enterFullscreenVideo(View view) {
31 mView.setOverlayVideoMode(true);
32 CustomViewCallback cb = new CustomViewCallback() {
34 public void onCustomViewHidden() {
35 ContentVideoView contentVideoView = ContentVideoView.getContentVideoView();
36 if (contentVideoView != null) contentVideoView.exitFullscreen(false);
39 mContentsClient.onShowCustomView(view, cb);
43 public void exitFullscreenVideo() {
44 mView.setOverlayVideoMode(false);
45 mContentsClient.onHideCustomView();
49 public View getVideoLoadingProgressView() {