1 // Copyright 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.chromium.content.browser;
7 import android.app.Activity;
8 import android.view.Gravity;
9 import android.view.View;
10 import android.view.ViewGroup;
11 import android.view.WindowManager;
12 import android.widget.FrameLayout;
15 * Uses an existing Activity to handle displaying video in full screen.
17 public class ActivityContentVideoViewClient implements ContentVideoViewClient {
18 private final Activity mActivity;
21 public ActivityContentVideoViewClient(Activity activity) {
22 this.mActivity = activity;
26 public boolean onShowCustomView(View view) {
27 mActivity.getWindow().setFlags(
28 WindowManager.LayoutParams.FLAG_FULLSCREEN,
29 WindowManager.LayoutParams.FLAG_FULLSCREEN);
31 mActivity.getWindow().addContentView(view,
32 new FrameLayout.LayoutParams(
33 ViewGroup.LayoutParams.MATCH_PARENT,
34 ViewGroup.LayoutParams.MATCH_PARENT,
41 public void onDestroyContentVideoView() {
42 mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
43 FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
44 decor.removeView(mView);
49 public View getVideoLoadingProgressView() {