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

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

Issue 2178973004: DialogSurfaceManager implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DialogSurfaceManager.java => DialogSurfaceManagerImpl.java and stopped using activity for window to… Created 4 years, 1 month 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/DialogSurfaceActivityMapper.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/DialogSurfaceActivityMapper.java b/content/public/android/java/src/org/chromium/content/browser/DialogSurfaceActivityMapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..e61387447d30dbe648582ed85153b37010b090f3
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/DialogSurfaceActivityMapper.java
@@ -0,0 +1,54 @@
+// 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.content.browser;
+
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.view.ViewGroup;
+
+import org.chromium.base.Log;
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.media.IDialogSurfaceActivityMapper;
+import org.chromium.media.IDialogSurfaceHolder;
+
+/**
+ * Implementation of IDialogSurfaceActivityMapper.
+ * Provided by ChildProcessLauncher to DialogSurfaceManager.
+ */
+public class DialogSurfaceActivityMapper extends IDialogSurfaceActivityMapper.Stub {
boliu 2016/11/04 00:07:19 @JNINamespace("content") so native side can live i
liberato (no reviews please) 2016/11/11 21:52:35 Done.
+ private static final String TAG = "cr_DialogSurfaceAM";
+
+ @Override
+ public void postWindowToken(int rendererPid, int renderFrameId, IDialogSurfaceHolder holder) {
boliu 2016/11/04 00:07:19 I didn't find the caller of this binder call? want
liberato (no reviews please) 2016/11/11 21:52:35 i split this cl in half, and the caller isn't here
+ nativeCallBackWithContentViewCore(rendererPid, renderFrameId, this, holder);
+ }
+
+ /**
+ * Receive a callback from native with a previously requested ContentViewCore.
+ */
+ @CalledByNative
+ private void onContentViewCore(IDialogSurfaceHolder holder, ContentViewCore cvc) {
+ IBinder token = null;
+
+ if (cvc != null) {
+ ViewGroup viewGroup = cvc.getContainerView();
+ if (viewGroup != null) {
+ token = viewGroup.getWindowToken();
+ }
+ }
+
+ try {
+ holder.onWindowToken(token);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Unable to post window token to DialogSurfaceHolder", e);
boliu 2016/11/04 00:07:19 Log.d (to avoid bloating release binary)
liberato (no reviews please) 2016/11/11 21:52:35 Done.
+ }
+ }
+
+ // Look up the ContentViewCore for (rendererPid, renderFrameId), and call
+ // back onContentViewCore with it and |holder|. The callback will happen
+ // on the browser UI thread.
+ private static native void nativeCallBackWithContentViewCore(int rendererPid, int renderFrameId,
+ DialogSurfaceActivityMapper mapper, IDialogSurfaceHolder holder);
+}

Powered by Google App Engine
This is Rietveld 408576698