| Index: media/base/android/java/src/org/chromium/media/DialogSurfaceWrapper.java
|
| diff --git a/media/base/android/java/src/org/chromium/media/DialogSurfaceWrapper.java b/media/base/android/java/src/org/chromium/media/DialogSurfaceWrapper.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7ca0bfd0d1170c19b3834f551bca6766430b151c
|
| --- /dev/null
|
| +++ b/media/base/android/java/src/org/chromium/media/DialogSurfaceWrapper.java
|
| @@ -0,0 +1,57 @@
|
| +// Copyright 2016 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.media;
|
| +
|
| +import android.os.IBinder;
|
| +import android.os.RemoteException;
|
| +import android.view.Surface;
|
| +
|
| +import org.chromium.base.annotations.CalledByNative;
|
| +import org.chromium.base.annotations.JNINamespace;
|
| +
|
| +/**
|
| + * Wrapper for IDialogSurface for JNI bindings.
|
| + *
|
| + * Makes any implementation of IDialogSurface accessible through JNI.
|
| + * Doesn't have to implement IDialogSurface, except that it's an easy
|
| + * way to keep the interface in sync.
|
| + */
|
| +@JNINamespace("media")
|
| +class DialogSurfaceWrapper implements IDialogSurface {
|
| + private final IDialogSurface mDialogSurface;
|
| +
|
| + public DialogSurfaceWrapper(IDialogSurface dialogSurface) {
|
| + mDialogSurface = dialogSurface;
|
| + }
|
| +
|
| + @CalledByNative
|
| + private static DialogSurfaceWrapper wrap(IDialogSurface dialogSurface) {
|
| + return new DialogSurfaceWrapper(dialogSurface);
|
| + }
|
| +
|
| + @Override
|
| + @CalledByNative
|
| + public void release() throws RemoteException {
|
| + mDialogSurface.release();
|
| + }
|
| +
|
| + @Override
|
| + @CalledByNative
|
| + public Surface getSurface() throws RemoteException {
|
| + return mDialogSurface.getSurface();
|
| + }
|
| +
|
| + @Override
|
| + @CalledByNative
|
| + public void scheduleLayoutSurface(final int x, final int y, final int width, final int height)
|
| + throws RemoteException {
|
| + mDialogSurface.scheduleLayoutSurface(x, y, width, height);
|
| + }
|
| +
|
| + @Override
|
| + public IBinder asBinder() {
|
| + return null;
|
| + }
|
| +}
|
|
|