| Index: content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
|
| diff --git a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
|
| index 13aa756e8f9ed9dce4105cc23f939de6f1463569..2655c184646f4303a0c4826ac3cbfea87b54363b 100644
|
| --- a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
|
| +++ b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
|
| @@ -27,6 +27,8 @@ import org.chromium.content_public.browser.ImageDownloadCallback;
|
| import org.chromium.content_public.browser.JavaScriptCallback;
|
| import org.chromium.content_public.browser.MessagePort;
|
| import org.chromium.content_public.browser.NavigationController;
|
| +import org.chromium.content_public.browser.RenderFrameHost;
|
| +import org.chromium.content_public.browser.RenderFrameHostDelegate;
|
| import org.chromium.content_public.browser.SmartClipCallback;
|
| import org.chromium.content_public.browser.WebContents;
|
| import org.chromium.content_public.browser.WebContentsObserver;
|
| @@ -42,9 +44,9 @@ import java.util.UUID;
|
| * object.
|
| */
|
| @JNINamespace("content")
|
| -//TODO(tedchoc): Remove the package restriction once this class moves to a non-public content
|
| +// TODO(tedchoc): Remove the package restriction once this class moves to a non-public content
|
| // package whose visibility will be enforced via DEPS.
|
| -/* package */ class WebContentsImpl implements WebContents {
|
| +/* package */ class WebContentsImpl implements WebContents, RenderFrameHostDelegate {
|
| private static final String PARCEL_VERSION_KEY = "version";
|
| private static final String PARCEL_WEBCONTENTS_KEY = "webcontents";
|
| private static final String PARCEL_PROCESS_GUARD_KEY = "processguard";
|
| @@ -93,6 +95,7 @@ import java.util.UUID;
|
|
|
| private long mNativeWebContentsAndroid;
|
| private NavigationController mNavigationController;
|
| + private RenderFrameHost mMainFrame;
|
|
|
| // Lazily created proxy observer for handling all Java-based WebContentsObservers.
|
| private WebContentsObserverProxy mObserverProxy;
|
| @@ -166,6 +169,14 @@ import java.util.UUID;
|
| }
|
|
|
| @Override
|
| + public RenderFrameHost getMainFrame() {
|
| + if (mMainFrame == null) {
|
| + mMainFrame = nativeGetMainFrame(mNativeWebContentsAndroid);
|
| + }
|
| + return mMainFrame;
|
| + }
|
| +
|
| + @Override
|
| public String getTitle() {
|
| return nativeGetTitle(mNativeWebContentsAndroid);
|
| }
|
| @@ -552,11 +563,17 @@ import java.util.UUID;
|
| sizes.add(new Rect(0, 0, width, height));
|
| }
|
|
|
| + @Override
|
| + public WebContents getAsWebContents() {
|
| + return this;
|
| + }
|
| +
|
| // This is static to avoid exposing a public destroy method on the native side of this class.
|
| private static native void nativeDestroyWebContents(long webContentsAndroidPtr);
|
|
|
| private static native WebContents nativeFromNativePtr(long webContentsAndroidPtr);
|
|
|
| + private native RenderFrameHost nativeGetMainFrame(long nativeWebContentsAndroid);
|
| private native String nativeGetTitle(long nativeWebContentsAndroid);
|
| private native String nativeGetVisibleURL(long nativeWebContentsAndroid);
|
| private native boolean nativeIsLoading(long nativeWebContentsAndroid);
|
|
|