| 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 "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_browser_main_parts.h" | 7 #include "android_webview/browser/aw_browser_main_parts.h" |
| 8 #include "android_webview/browser/net_disk_cache_remover.h" | 8 #include "android_webview/browser/net_disk_cache_remover.h" |
| 9 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 9 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
| 10 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" | 10 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 return; | 293 return; |
| 294 | 294 |
| 295 ScopedJavaLocalRef<jstring> jurl(ConvertUTF8ToJavaString( | 295 ScopedJavaLocalRef<jstring> jurl(ConvertUTF8ToJavaString( |
| 296 env, origin_url.spec())); | 296 env, origin_url.spec())); |
| 297 ScopedJavaLocalRef<jstring> jmessage(ConvertUTF16ToJavaString( | 297 ScopedJavaLocalRef<jstring> jmessage(ConvertUTF16ToJavaString( |
| 298 env, message_text)); | 298 env, message_text)); |
| 299 Java_AwContents_handleJsBeforeUnload( | 299 Java_AwContents_handleJsBeforeUnload( |
| 300 env, obj.obj(), jurl.obj(), jmessage.obj(), js_result.obj()); | 300 env, obj.obj(), jurl.obj(), jmessage.obj(), js_result.obj()); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void AwContents::ConvertContextMenuCallbackToLongPress() { |
| 304 JNIEnv* env = AttachCurrentThread(); |
| 305 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 306 if (obj.is_null()) |
| 307 return; |
| 308 |
| 309 Java_AwContents_onLongPress(env, obj.obj()); |
| 310 } |
| 311 |
| 303 void AwContents::onReceivedHttpAuthRequest( | 312 void AwContents::onReceivedHttpAuthRequest( |
| 304 const JavaRef<jobject>& handler, | 313 const JavaRef<jobject>& handler, |
| 305 const std::string& host, | 314 const std::string& host, |
| 306 const std::string& realm) { | 315 const std::string& realm) { |
| 307 JNIEnv* env = AttachCurrentThread(); | 316 JNIEnv* env = AttachCurrentThread(); |
| 308 ScopedJavaLocalRef<jstring> jhost = ConvertUTF8ToJavaString(env, host); | 317 ScopedJavaLocalRef<jstring> jhost = ConvertUTF8ToJavaString(env, host); |
| 309 ScopedJavaLocalRef<jstring> jrealm = ConvertUTF8ToJavaString(env, realm); | 318 ScopedJavaLocalRef<jstring> jrealm = ConvertUTF8ToJavaString(env, realm); |
| 310 Java_AwContents_onReceivedHttpAuthRequest(env, java_ref_.get(env).obj(), | 319 Java_AwContents_onReceivedHttpAuthRequest(env, java_ref_.get(env).obj(), |
| 311 handler.obj(), jhost.obj(), | 320 handler.obj(), jhost.obj(), |
| 312 jrealm.obj()); | 321 jrealm.obj()); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 return; | 548 return; |
| 540 } | 549 } |
| 541 pending_contents_ = pending.Pass(); | 550 pending_contents_ = pending.Pass(); |
| 542 } | 551 } |
| 543 | 552 |
| 544 jint AwContents::ReleasePopupWebContents(JNIEnv* env, jobject obj) { | 553 jint AwContents::ReleasePopupWebContents(JNIEnv* env, jobject obj) { |
| 545 return reinterpret_cast<jint>(pending_contents_.release()); | 554 return reinterpret_cast<jint>(pending_contents_.release()); |
| 546 } | 555 } |
| 547 | 556 |
| 548 } // namespace android_webview | 557 } // namespace android_webview |
| OLD | NEW |