Index: components/web_contents_delegate_android/web_contents_delegate_android.cc |
diff --git a/components/web_contents_delegate_android/web_contents_delegate_android.cc b/components/web_contents_delegate_android/web_contents_delegate_android.cc |
index 178ae3d95160c834fb143bcff515265a1b21358d..a41ab12e2a1c30f31e1ab46305304f6d5a298723 100644 |
--- a/components/web_contents_delegate_android/web_contents_delegate_android.cc |
+++ b/components/web_contents_delegate_android/web_contents_delegate_android.cc |
@@ -216,6 +216,57 @@ void WebContentsDelegateAndroid::RendererResponsive(WebContents* source) { |
Java_WebContentsDelegateAndroid_rendererResponsive(env, obj.obj()); |
} |
+void WebContentsDelegateAndroid::DidNavigateToPendingEntry( |
+ WebContents* source) { |
+ JNIEnv* env = AttachCurrentThread(); |
+ ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
+ if (obj.is_null()) |
+ return; |
+ Java_WebContentsDelegateAndroid_didNavigateToPendingEntry(env, obj.obj()); |
+} |
+ |
+bool WebContentsDelegateAndroid::ShouldCreateWebContents( |
+ WebContents* web_contents, |
+ int route_id, |
+ WindowContainerType window_container_type, |
+ const base::string16& frame_name, |
+ const GURL& target_url, |
+ const std::string& partition_id, |
+ content::SessionStorageNamespace* session_storage_namespace) { |
+ JNIEnv* env = AttachCurrentThread(); |
+ ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
+ if (obj.is_null()) |
+ return true; |
benm (inactive)
2014/11/05 14:44:27
is true the right return value here? It sounds a l
Ted C
2014/11/05 16:46:10
These are both the defaults in web_contents_delega
|
+ ScopedJavaLocalRef<jstring> java_url = |
+ ConvertUTF8ToJavaString(env, target_url.spec()); |
+ return Java_WebContentsDelegateAndroid_shouldCreateWebContents(env, obj.obj(), |
+ java_url.obj()); |
+} |
+ |
+bool WebContentsDelegateAndroid::OnGoToEntryOffset(int offset) { |
+ JNIEnv* env = AttachCurrentThread(); |
+ ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
+ if (obj.is_null()) |
+ return true; |
benm (inactive)
2014/11/05 14:44:27
is true the right return value here? It sounds a l
|
+ return Java_WebContentsDelegateAndroid_onGoToEntryOffset(env, obj.obj(), |
+ offset); |
+} |
+ |
+void WebContentsDelegateAndroid::WebContentsCreated( |
+ WebContents* source_contents, int opener_render_frame_id, |
+ const base::string16& frame_name, const GURL& target_url, |
+ WebContents* new_contents) { |
+ JNIEnv* env = AttachCurrentThread(); |
+ ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
+ if (obj.is_null()) |
+ return; |
+ Java_WebContentsDelegateAndroid_webContentsCreated(env, obj.obj(), |
+ reinterpret_cast<intptr_t>(source_contents), opener_render_frame_id, |
Ted C
2014/11/05 16:46:10
Instead of passing the raw pointer to java, can yo
Ted C
2014/11/05 16:46:11
Since the params don't all fit on a single line, e
|
+ base::android::ConvertUTF16ToJavaString(env, frame_name).Release(), |
+ base::android::ConvertUTF8ToJavaString(env, target_url.spec()).Release(), |
+ reinterpret_cast<intptr_t>(new_contents)); |
+} |
+ |
void WebContentsDelegateAndroid::CloseContents(WebContents* source) { |
JNIEnv* env = AttachCurrentThread(); |
ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |