Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/ContentView.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentView.java b/content/public/android/java/src/org/chromium/content/browser/ContentView.java |
| index fa5cea7c75e3b031d60674b0af8a0d2829701ea0..ea6a0d56cfe1efe9717f31d2620826a2ee2e84e1 100644 |
| --- a/content/public/android/java/src/org/chromium/content/browser/ContentView.java |
| +++ b/content/public/android/java/src/org/chromium/content/browser/ContentView.java |
| @@ -15,6 +15,8 @@ import android.util.AttributeSet; |
| import android.view.KeyEvent; |
| import android.view.MotionEvent; |
| import android.view.View; |
| +import android.view.SurfaceHolder; |
| +import android.view.SurfaceView; |
| import android.view.accessibility.AccessibilityEvent; |
| import android.view.accessibility.AccessibilityNodeInfo; |
| import android.view.inputmethod.EditorInfo; |
| @@ -103,12 +105,37 @@ public class ContentView extends FrameLayout implements ContentViewCore.Internal |
| } |
| } |
| + private SurfaceView mExternalVideoSurfaceView; |
| + |
| protected ContentView(Context context, int nativeWebContents, NativeWindow nativeWindow, |
| AttributeSet attrs, int defStyle, int personality) { |
| super(context, attrs, defStyle); |
| mContentViewCore = new ContentViewCore(context, personality); |
| mContentViewCore.initialize(this, this, nativeWebContents, nativeWindow, false); |
| + |
| + mExternalVideoSurfaceView = new SurfaceView(getContext()); |
|
no sievers
2013/03/05 19:54:16
Not sure you always want to create the SurfaceView
wonsik
2013/03/06 02:48:20
To create SurfaceView only when needed, ContentVie
|
| + mExternalVideoSurfaceView.getHolder().addCallback(new SurfaceHolder.Callback() { |
| + @Override |
| + public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { |
| + } |
| + |
| + @Override |
| + public void surfaceCreated(SurfaceHolder holder) { |
| + mContentViewCore.externalVideoSurfaceCreated(holder.getSurface()); |
| + } |
| + |
| + @Override |
| + public void surfaceDestroyed(SurfaceHolder holder) { |
| + mContentViewCore.externalVideoSurfaceDestroyed(holder.getSurface()); |
| + } |
| + }); |
| + |
| + addView(mExternalVideoSurfaceView, |
| + new FrameLayout.LayoutParams( |
| + FrameLayout.LayoutParams.MATCH_PARENT, |
| + FrameLayout.LayoutParams.MATCH_PARENT)); |
| + mExternalVideoSurfaceView.setZOrderMediaOverlay(false); |
| } |
| /** |