OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.media; |
| 6 |
| 7 import android.os.IBinder; |
| 8 |
| 9 /** |
| 10 * Class to facilitate mapping (pid, render_frame_id) to an Activity. Should |
| 11 * also handle registering for changes if the render frame is re-parented to |
| 12 * another activity. |
| 13 */ |
| 14 public interface DialogSurfaceWindowTokenProvider { |
| 15 /** |
| 16 * Client to receive callbacks from the token provider. |
| 17 */ |
| 18 interface Client { |
| 19 // Notify the client of a new window token, or null if no token is |
| 20 // currently available. This callback will happen on the UI thread. |
| 21 void onWindowToken(IBinder token); |
| 22 } |
| 23 |
| 24 /** |
| 25 * Eventually call back |client::onWindowToken| with the window token for |
| 26 * the activity that hosts (rendererPid, renderFrameId). This will call |
| 27 * back, but may call back with null. It may call back more than once if |
| 28 * the token changes. |
| 29 */ |
| 30 void registerClient(int rendererPid, int renderFrameId, Client client); |
| 31 |
| 32 /** |
| 33 * Unregister |client| for callbacks. Some callbacks may be in-flight, and |
| 34 * could arrive after this returns. |
| 35 */ |
| 36 void unregisterClient(Client client); |
| 37 } |
OLD | NEW |