| Index: media/base/android/java/src/org/chromium/media/DialogSurfaceWindowTokenProvider.java
|
| diff --git a/media/base/android/java/src/org/chromium/media/DialogSurfaceWindowTokenProvider.java b/media/base/android/java/src/org/chromium/media/DialogSurfaceWindowTokenProvider.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..37701ecc7214dfc756bfe534bd8a9179e20a4a97
|
| --- /dev/null
|
| +++ b/media/base/android/java/src/org/chromium/media/DialogSurfaceWindowTokenProvider.java
|
| @@ -0,0 +1,37 @@
|
| +// 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;
|
| +
|
| +/**
|
| + * Class to facilitate mapping (pid, render_frame_id) to an Activity. Should
|
| + * also handle registering for changes if the render frame is re-parented to
|
| + * another activity.
|
| + */
|
| +public interface DialogSurfaceWindowTokenProvider {
|
| + /**
|
| + * Client to receive callbacks from the token provider.
|
| + */
|
| + interface Client {
|
| + // Notify the client of a new window token, or null if no token is
|
| + // currently available. This callback will happen on the UI thread.
|
| + void onWindowToken(IBinder token);
|
| + }
|
| +
|
| + /**
|
| + * Eventually call back |client::onWindowToken| with the window token for
|
| + * the activity that hosts (rendererPid, renderFrameId). This will call
|
| + * back, but may call back with null. It may call back more than once if
|
| + * the token changes.
|
| + */
|
| + void registerClient(int rendererPid, int renderFrameId, Client client);
|
| +
|
| + /**
|
| + * Unregister |client| for callbacks. Some callbacks may be in-flight, and
|
| + * could arrive after this returns.
|
| + */
|
| + void unregisterClient(Client client);
|
| +}
|
|
|