Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ActivityContentVideoViewDelegate.java

Issue 11412076: Create a ContentVideoViewDelegate.java (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compiler errors Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ActivityContentVideoViewDelegate.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ActivityContentVideoViewDelegate.java b/content/public/android/java/src/org/chromium/content/browser/ActivityContentVideoViewDelegate.java
new file mode 100644
index 0000000000000000000000000000000000000000..335e329af1078daca88d3c80ad0cfaa2263051ad
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/ActivityContentVideoViewDelegate.java
@@ -0,0 +1,67 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser;
+
+import android.app.Activity;
+import android.content.Context;
+import android.view.Gravity;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.WindowManager;
+import android.widget.FrameLayout;
+
+import org.chromium.content.browser.ContentVideoViewContextDelegate;
+import org.chromium.content.R;
+
+/**
+ * Uses an exisiting Activity to handle displaying video in full screen.
+ */
+public class ActivityContentVideoViewDelegate implements ContentVideoViewContextDelegate {
+ private Activity mActivity;
+
+ public ActivityContentVideoViewDelegate(Activity activity) {
+ this.mActivity = activity;
+ }
+
+ public void onShowCustomView(View view) {
+ mActivity.getWindow().setFlags(
+ WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+
+ mActivity.getWindow().addContentView(view,
+ new FrameLayout.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ Gravity.CENTER));
+ }
+
+ public void onDestroyContentVideoView() {
+ mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+
+ public Context getContext() {
+ return mActivity;
+ }
+
+ public String getPlayBackErrorText() {
+ return mActivity.getString(R.string.media_player_error_text_invalid_progressive_playback);
+ }
+
+ public String getUnknownErrorText() {
+ return mActivity.getString(R.string.media_player_error_text_unknown);
+ }
+
+ public String getErrorButton() {
+ return mActivity.getString(R.string.media_player_error_button);
+ }
+
+ public String getErrorTitle() {
+ return mActivity.getString(R.string.media_player_error_title);
+ }
+
+ public String getVideoLoadingText() {
+ return mActivity.getString(R.string.media_player_loading_video);
+ }
+}
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentVideoView.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698