Commit b5c617e8 authored by yfriedman's avatar yfriedman Committed by Commit bot

Upstream ChromeTab.hasPrerenderedUrl to Tab

It was just passing straight through on the native side.
BUG=443773

Review URL: https://codereview.chromium.org/949443002

Cr-Commit-Position: refs/heads/master@{#317584}
parent 70448f92
...@@ -2469,6 +2469,11 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener, ...@@ -2469,6 +2469,11 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
return mAppBannerManager; return mAppBannerManager;
} }
@VisibleForTesting
public boolean hasPrerenderedUrl(String url) {
return nativeHasPrerenderedUrl(mNativeTabAndroid, url);
}
/** /**
* Ensures the counter is at least as high as the specified value. The counter should always * Ensures the counter is at least as high as the specified value. The counter should always
* point to an unused ID (which will be handed out next time a request comes in). Exposed so * point to an unused ID (which will be handed out next time a request comes in). Exposed so
...@@ -2512,5 +2517,7 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener, ...@@ -2512,5 +2517,7 @@ public class Tab implements ViewGroup.OnHierarchyChangeListener,
ContentViewCore content, boolean visible); ContentViewCore content, boolean visible);
private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid, private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid,
ContentViewCore content); ContentViewCore content);
private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url);
private static native void nativeRecordStartupToCommitUma(); private static native void nativeRecordStartupToCommitUma();
} }
...@@ -764,6 +764,11 @@ jlong TabAndroid::GetBookmarkId(JNIEnv* env, ...@@ -764,6 +764,11 @@ jlong TabAndroid::GetBookmarkId(JNIEnv* env,
return -1; return -1;
} }
bool TabAndroid::HasPrerenderedUrl(JNIEnv* env, jobject obj, jstring url) {
GURL gurl(base::android::ConvertJavaStringToUTF8(env, url));
return HasPrerenderedUrl(gurl);
}
namespace { namespace {
class ChromeInterceptNavigationDelegate : public InterceptNavigationDelegate { class ChromeInterceptNavigationDelegate : public InterceptNavigationDelegate {
......
...@@ -211,6 +211,8 @@ class TabAndroid : public CoreTabHelperDelegate, ...@@ -211,6 +211,8 @@ class TabAndroid : public CoreTabHelperDelegate,
jobject obj, jobject obj,
jobject jcontent_view_core); jobject jcontent_view_core);
bool HasPrerenderedUrl(JNIEnv* env, jobject obj, jstring url);
// Register the Tab's native methods through JNI. // Register the Tab's native methods through JNI.
static bool RegisterTabAndroid(JNIEnv* env); static bool RegisterTabAndroid(JNIEnv* env);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment