OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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.content.browser.androidoverlay; |
| 6 |
| 7 import android.app.Dialog; |
| 8 import android.content.Context; |
| 9 import android.os.Handler; |
| 10 import android.os.IBinder; |
| 11 import android.view.Surface; |
| 12 |
| 13 /** |
| 14 * Common operations needed by DialogOverlayImpl, which are handy to mock out. |
| 15 */ |
| 16 interface DialogOverlayOperations { |
| 17 interface WindowTokenListener { |
| 18 void onWindowToken(final IBinder token); |
| 19 public void onDismissed(); |
| 20 } |
| 21 |
| 22 /** |
| 23 * Notify that the overlay has been released by the client. |
| 24 * This will be called on the Browser UI thread. |
| 25 */ |
| 26 void notifyReleased(); |
| 27 |
| 28 /** |
| 29 * Create the dialog. This will be called on the overlay-ui thread. |
| 30 * @param context The context that we'll provide to the dialog. |
| 31 */ |
| 32 Dialog createDialog(Context context); |
| 33 |
| 34 /** |
| 35 * Return a Handler that can post tasks to the overlay-ui thread. |
| 36 */ |
| 37 Handler getOverlayUiHandler(); |
| 38 |
| 39 /** |
| 40 * Start receiving window token updates on |listener|. This may only be cal
led once. |
| 41 * @param token routing token that we'll use to find the window token. |
| 42 * @param listener listener that we'll send updates to. |
| 43 */ |
| 44 void registerWindowTokenListener( |
| 45 org.chromium.mojo.common.mojom.UnguessableToken token, WindowTokenLi
stener listener); |
| 46 |
| 47 /** |
| 48 * Unregister the current listener. |
| 49 */ |
| 50 void unregisterWindowTokenListener(); |
| 51 |
| 52 /** |
| 53 * Register a surface and return the surface id for it. |
| 54 * @param surface Surface that we should register. |
| 55 * @return surface id that we associated with |surface|. |
| 56 */ |
| 57 int registerSurface(Surface surface); |
| 58 void unregisterSurface(int surfaceId); |
| 59 } |
OLD | NEW |