Chromium Code Reviews| Index: content/public/android/java/src/org/chromium/content/browser/androidoverlay/DialogOverlayOperations.java |
| diff --git a/content/public/android/java/src/org/chromium/content/browser/androidoverlay/DialogOverlayOperations.java b/content/public/android/java/src/org/chromium/content/browser/androidoverlay/DialogOverlayOperations.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ca0dd0b8061c4bbe118f03a7eb45cd8e2e54d60e |
| --- /dev/null |
| +++ b/content/public/android/java/src/org/chromium/content/browser/androidoverlay/DialogOverlayOperations.java |
| @@ -0,0 +1,52 @@ |
| +// Copyright 2017 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.content.browser.androidoverlay; |
| + |
| +import android.os.Handler; |
| +import android.os.IBinder; |
| +import android.view.Surface; |
| + |
| +/** |
| + * Common operations needed by DialogOverlayImpl, which are handy to mock out. |
| + */ |
| +interface DialogOverlayOperations { |
|
boliu
2017/04/22 00:22:43
is this interface necessary? I don't see any tests
liberato (no reviews please)
2017/04/24 22:19:42
i had planned to add a DialogOverlayImpl junit tes
|
| + interface WindowTokenListener { |
| + void onWindowToken(final IBinder token); |
| + public void onDismissed(); |
| + } |
| + |
| + /** |
| + * Notify that the overlay has been released by the client. |
| + * This will be called on the Browser UI thread. |
| + */ |
| + void notifyReleased(); |
| + |
| + /** |
| + * Return a Handler that can post tasks to the overlay thread. |
| + */ |
| + Handler getOverlayHandler(); |
| + |
| + /** |
| + * Start receiving window token updates on |listener|. This may only be called once. |
| + * @param token routing token that we'll use to find the window token. |
| + * @param listener listener that we'll send updates to. |
| + */ |
| + void registerWindowTokenListener( |
| + org.chromium.mojo.common.mojom.UnguessableToken token, WindowTokenListener listener); |
| + |
| + /** |
| + * Unregister the current listener, if any. It is okay to call this without having called |
| + * registerWindowTokenListener, and / or calling this more than once. |
| + */ |
| + void unregisterWindowTokenListenerIfNeeded(); |
| + |
| + /** |
| + * Register a surface and return the surface id for it. |
| + * @param surface Surface that we should register. |
| + * @return surface id that we associated with |surface|. |
| + */ |
| + int registerSurface(Surface surface); |
| + void unregisterSurface(int surfaceId); |
| +} |