OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/web_contents_delegate_android/web_contents_delegate_android .h" | 5 #include "components/web_contents_delegate_android/web_contents_delegate_android .h" |
6 | 6 |
7 #include <android/keycodes.h> | 7 #include <android/keycodes.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
202 | 202 |
203 bool WebContentsDelegateAndroid::OnGoToEntryOffset(int offset) { | 203 bool WebContentsDelegateAndroid::OnGoToEntryOffset(int offset) { |
204 JNIEnv* env = AttachCurrentThread(); | 204 JNIEnv* env = AttachCurrentThread(); |
205 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 205 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
206 if (obj.is_null()) | 206 if (obj.is_null()) |
207 return true; | 207 return true; |
208 return Java_WebContentsDelegateAndroid_onGoToEntryOffset(env, obj, offset); | 208 return Java_WebContentsDelegateAndroid_onGoToEntryOffset(env, obj, offset); |
209 } | 209 } |
210 | 210 |
211 void WebContentsDelegateAndroid::WebContentsCreated( | 211 void WebContentsDelegateAndroid::WebContentsCreated( |
212 WebContents* source_contents, int opener_render_frame_id, | 212 WebContents* source_contents, |
213 const std::string& frame_name, const GURL& target_url, | 213 int opener_render_process_id, |
214 int opener_render_frame_id, | |
215 const std::string& frame_name, | |
216 const GURL& target_url, | |
214 WebContents* new_contents) { | 217 WebContents* new_contents) { |
215 JNIEnv* env = AttachCurrentThread(); | 218 JNIEnv* env = AttachCurrentThread(); |
216 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 219 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
217 if (obj.is_null()) | 220 if (obj.is_null()) |
218 return; | 221 return; |
219 | 222 |
220 ScopedJavaLocalRef<jobject> jsource_contents; | 223 ScopedJavaLocalRef<jobject> jsource_contents; |
221 if (source_contents) | 224 if (source_contents) |
222 jsource_contents = source_contents->GetJavaWebContents(); | 225 jsource_contents = source_contents->GetJavaWebContents(); |
223 ScopedJavaLocalRef<jobject> jnew_contents; | 226 ScopedJavaLocalRef<jobject> jnew_contents; |
224 if (new_contents) | 227 if (new_contents) |
225 jnew_contents = new_contents->GetJavaWebContents(); | 228 jnew_contents = new_contents->GetJavaWebContents(); |
226 | 229 |
227 Java_WebContentsDelegateAndroid_webContentsCreated( | 230 Java_WebContentsDelegateAndroid_webContentsCreated( |
Charlie Reis
2016/10/03 22:15:23
I won't ask you to dive into this in this CL, but
nasko
2016/10/03 22:38:04
I'll file a bug to get this fixed or do it in a se
| |
228 env, obj, jsource_contents, opener_render_frame_id, | 231 env, obj, jsource_contents, opener_render_frame_id, |
229 base::android::ConvertUTF8ToJavaString(env, frame_name), | 232 base::android::ConvertUTF8ToJavaString(env, frame_name), |
230 base::android::ConvertUTF8ToJavaString(env, target_url.spec()), | 233 base::android::ConvertUTF8ToJavaString(env, target_url.spec()), |
231 jnew_contents); | 234 jnew_contents); |
232 } | 235 } |
233 | 236 |
234 void WebContentsDelegateAndroid::CloseContents(WebContents* source) { | 237 void WebContentsDelegateAndroid::CloseContents(WebContents* source) { |
235 JNIEnv* env = AttachCurrentThread(); | 238 JNIEnv* env = AttachCurrentThread(); |
236 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 239 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
237 if (obj.is_null()) | 240 if (obj.is_null()) |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
404 validation_message_bubble_->SetPositionRelativeToAnchor( | 407 validation_message_bubble_->SetPositionRelativeToAnchor( |
405 rwhv->GetRenderWidgetHost(), anchor_in_root_view); | 408 rwhv->GetRenderWidgetHost(), anchor_in_root_view); |
406 } | 409 } |
407 } | 410 } |
408 | 411 |
409 void WebContentsDelegateAndroid::RequestAppBannerFromDevTools( | 412 void WebContentsDelegateAndroid::RequestAppBannerFromDevTools( |
410 content::WebContents* web_contents) { | 413 content::WebContents* web_contents) { |
411 } | 414 } |
412 | 415 |
413 } // namespace web_contents_delegate_android | 416 } // namespace web_contents_delegate_android |
OLD | NEW |