EMMA Coverage Report (generated Fri Aug 23 16:39:17 PDT 2013)
[all classes][org.chromium.content.browser]

COVERAGE SUMMARY FOR SOURCE FILE [ActivityContentVideoViewClient.java]

nameclass, %method, %block, %line, %
ActivityContentVideoViewClient.java0%   (0/1)0%   (0/5)0%   (0/50)0%   (0/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ActivityContentVideoViewClient0%   (0/1)0%   (0/5)0%   (0/50)0%   (0/14)
ActivityContentVideoViewClient (Activity): void 0%   (0/1)0%   (0/6)0%   (0/3)
createControls (): ContentVideoViewControls 0%   (0/1)0%   (0/2)0%   (0/1)
getVideoLoadingProgressView (): View 0%   (0/1)0%   (0/2)0%   (0/1)
onDestroyContentVideoView (): void 0%   (0/1)0%   (0/19)0%   (0/5)
onShowCustomView (View): void 0%   (0/1)0%   (0/21)0%   (0/4)

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.
4 
5package org.chromium.content.browser;
6 
7import android.app.Activity;
8import android.view.Gravity;
9import android.view.View;
10import android.view.ViewGroup;
11import android.view.WindowManager;
12import android.widget.FrameLayout;
13 
14import org.chromium.content.browser.ContentVideoViewClient;
15 
16/**
17 * Uses an existing Activity to handle displaying video in full screen.
18 */
19public class ActivityContentVideoViewClient implements ContentVideoViewClient {
20    private Activity mActivity;
21    private View mView;
22 
23    public ActivityContentVideoViewClient(Activity activity)  {
24        this.mActivity = activity;
25    }
26 
27    @Override
28    public void onShowCustomView(View view) {
29        mActivity.getWindow().setFlags(
30                WindowManager.LayoutParams.FLAG_FULLSCREEN,
31                WindowManager.LayoutParams.FLAG_FULLSCREEN);
32 
33        mActivity.getWindow().addContentView(view,
34                new FrameLayout.LayoutParams(
35                        ViewGroup.LayoutParams.MATCH_PARENT,
36                        ViewGroup.LayoutParams.MATCH_PARENT,
37                        Gravity.CENTER));
38        mView = view;
39    }
40 
41    @Override
42    public void onDestroyContentVideoView() {
43        mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
44        FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
45        decor.removeView(mView);
46        mView = null;
47    }
48 
49    @Override
50    public View getVideoLoadingProgressView() {
51        return null;
52    }
53 
54    @Override
55    public ContentVideoViewControls createControls() {
56        return null;
57    }
58}

[all classes][org.chromium.content.browser]
EMMA 2.0.5312 (C) Vladimir Roubtsov