Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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.framehost; | |
| 6 | |
| 7 import org.chromium.base.annotations.CalledByNative; | |
| 8 import org.chromium.base.annotations.JNINamespace; | |
| 9 import org.chromium.content_public.browser.RenderFrameHost; | |
| 10 | |
| 11 /** | |
| 12 * The RenderFrameHostImpl Java wrapper to allow communicating with the native R enderFrameHost | |
| 13 * object. | |
| 14 */ | |
| 15 @JNINamespace("content") | |
| 16 // TODO(tedchoc): Remove the package restriction once this class moves to a non- public content | |
|
boliu
2017/03/06 23:12:38
remove this comment and the package part. WebConte
rwlbuis
2017/03/07 19:44:56
Done.
| |
| 17 // package whose visibility will be enforced via DEPS. | |
| 18 /* package */ public class RenderFrameHostImpl implements RenderFrameHost { | |
| 19 private long mNativeRenderFrameHostAndroid; | |
| 20 // mDelegate can be null. | |
| 21 final RenderFrameHostDelegate mDelegate; | |
| 22 | |
| 23 private RenderFrameHostImpl( | |
| 24 long nativeRenderFrameHostAndroid, RenderFrameHostDelegate delegate) { | |
| 25 mNativeRenderFrameHostAndroid = nativeRenderFrameHostAndroid; | |
| 26 mDelegate = delegate; | |
| 27 } | |
| 28 | |
| 29 @CalledByNative | |
| 30 private static RenderFrameHostImpl create( | |
| 31 long nativeRenderFrameHostAndroid, RenderFrameHostDelegate delegate) { | |
| 32 return new RenderFrameHostImpl(nativeRenderFrameHostAndroid, delegate); | |
| 33 } | |
| 34 | |
| 35 @CalledByNative | |
| 36 private void clearNativePtr() { | |
| 37 mNativeRenderFrameHostAndroid = 0; | |
| 38 } | |
| 39 | |
| 40 public RenderFrameHostDelegate getRenderFrameHostDelegate() { | |
| 41 return mDelegate; | |
| 42 } | |
| 43 | |
| 44 @Override | |
| 45 public String getLastCommittedURL() { | |
| 46 if (mNativeRenderFrameHostAndroid == 0) return null; | |
| 47 return nativeGetLastCommittedURL(mNativeRenderFrameHostAndroid); | |
| 48 } | |
| 49 | |
| 50 private native String nativeGetLastCommittedURL(long nativeRenderFrameHostAn droid); | |
| 51 } | |
| OLD | NEW |