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

Side by Side 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 unified diff | Download patch
OLDNEW
(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.content.browser;
6
7 import android.os.IBinder;
8 import android.os.RemoteException;
9 import android.view.ViewGroup;
10
11 import org.chromium.base.Log;
12 import org.chromium.base.annotations.CalledByNative;
13 import org.chromium.media.IDialogSurfaceActivityMapper;
14 import org.chromium.media.IDialogSurfaceHolder;
15
16 /**
17 * Implementation of IDialogSurfaceActivityMapper.
18 * Provided by ChildProcessLauncher to DialogSurfaceManager.
19 */
20 public class DialogSurfaceActivityMapper extends IDialogSurfaceActivityMapper.St ub {
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.
21 private static final String TAG = "cr_DialogSurfaceAM";
22
23 @Override
24 public void postWindowToken(int rendererPid, int renderFrameId, IDialogSurfa ceHolder 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
25 nativeCallBackWithContentViewCore(rendererPid, renderFrameId, this, hold er);
26 }
27
28 /**
29 * Receive a callback from native with a previously requested ContentViewCor e.
30 */
31 @CalledByNative
32 private void onContentViewCore(IDialogSurfaceHolder holder, ContentViewCore cvc) {
33 IBinder token = null;
34
35 if (cvc != null) {
36 ViewGroup viewGroup = cvc.getContainerView();
37 if (viewGroup != null) {
38 token = viewGroup.getWindowToken();
39 }
40 }
41
42 try {
43 holder.onWindowToken(token);
44 } catch (RemoteException e) {
45 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.
46 }
47 }
48
49 // Look up the ContentViewCore for (rendererPid, renderFrameId), and call
50 // back onContentViewCore with it and |holder|. The callback will happen
51 // on the browser UI thread.
52 private static native void nativeCallBackWithContentViewCore(int rendererPid , int renderFrameId,
53 DialogSurfaceActivityMapper mapper, IDialogSurfaceHolder holder);
54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698