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