Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/androidoverlay/DialogOverlayOperations.java

Issue 2765443004: AndroidOverlay implementation using Dialog. (Closed)
Patch Set: fixed gn Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..9bff991ce7074a3013a5ae7941bcb497f5d753e7
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/androidoverlay/DialogOverlayOperations.java
@@ -0,0 +1,59 @@
+// 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.app.Dialog;
+import android.content.Context;
+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 {
+ 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();
+
+ /**
+ * Create the dialog. This will be called on the overlay-ui thread.
+ * @param context The context that we'll provide to the dialog.
+ */
+ Dialog createDialog(Context context);
+
+ /**
+ * Return a Handler that can post tasks to the overlay-ui thread.
+ */
+ Handler getOverlayUiHandler();
+
+ /**
+ * 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.
+ */
+ void unregisterWindowTokenListener();
+
+ /**
+ * 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);
+}

Powered by Google App Engine
This is Rietveld 408576698