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

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/framehost/RenderFrameHostImpl.java

Issue 2681933002: Add Java wrapper for RenderFrameHost (Closed)
Patch Set: Try to address all review comments Created 3 years, 9 months 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 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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698