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

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

Issue 11412076: Create a ContentVideoViewDelegate.java (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: content/public/android/java/src/org/chromium/content/browser/AndroidContentVideoViewDelegate.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/AndroidContentVideoViewDelegate.java b/content/public/android/java/src/org/chromium/content/browser/AndroidContentVideoViewDelegate.java
new file mode 100644
index 0000000000000000000000000000000000000000..5b5eb02b900cb78d20d46e9ffb184ac4f938c434
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/AndroidContentVideoViewDelegate.java
@@ -0,0 +1,42 @@
+// 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.ContentVideoViewDelegate;
+
+public class AndroidContentVideoViewDelegate implements ContentVideoViewDelegate {
+ private Activity activity;
+
+ public AndroidContentVideoViewDelegate(Activity activity) {
+ this.activity = activity;
+ }
+
+ public void onShowCustomView(View view) {
+ activity.getWindow().setFlags(
+ WindowManager.LayoutParams.FLAG_FULLSCREEN,
+ WindowManager.LayoutParams.FLAG_FULLSCREEN);
+
+ activity.getWindow().addContentView(view,
+ new FrameLayout.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ Gravity.CENTER));
+ }
+
+ public void onDestroyContentVideoView() {
+ activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+
+ public Context getContext() {
+ return activity;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698