Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 } | |
| OLD | NEW |