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; |
+ } |
+} |