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 import org.chromium.content_public.browser.RenderFrameHostDelegate; | |
| 11 | |
| 12 /** | |
| 13 * The RenderFrameHostImpl Java wrapper to allow communicating with the native R enderFrameHost | |
| 14 * object. | |
| 15 */ | |
| 16 @JNINamespace("content") | |
| 17 // TODO(tedchoc): Remove the package restriction once this class moves to a non- public content | |
| 18 // package whose visibility will be enforced via DEPS. | |
| 19 /* package */ class RenderFrameHostImpl implements RenderFrameHost { | |
| 20 private long mNativeRenderFrameHostAndroid; | |
| 21 RenderFrameHostDelegate mDelegate; | |
|
boliu
2017/03/03 23:55:29
final, also comment that this may be null
rwlbuis
2017/03/06 20:58:58
Done.
| |
| 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 @Override | |
| 41 public RenderFrameHostDelegate getRenderFrameHostDelegate() { | |
| 42 return mDelegate; | |
| 43 } | |
| 44 | |
| 45 @Override | |
| 46 public String getLastCommittedURL() { | |
| 47 return nativeGetLastCommittedURL(mNativeRenderFrameHostAndroid); | |
|
boliu
2017/03/03 23:55:29
need to check for 0
rwlbuis
2017/03/06 20:58:58
Done.
| |
| 48 } | |
| 49 | |
| 50 private native String nativeGetLastCommittedURL(long nativeRenderFrameHostAn droid); | |
| 51 } | |
| OLD | NEW |