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

Unified Diff: components/web_contents_delegate_android/web_contents_delegate_android.cc

Issue 684133007: Make WebContentsDelegateAndroid pass more calls to Java. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/web_contents_delegate_android/web_contents_delegate_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..629cd06050db22d8ec24ed1cfa55707bba9a4d98 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,58 @@ 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;
+ 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;
+ 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,
+ 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);
« no previous file with comments | « components/web_contents_delegate_android/web_contents_delegate_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698