| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_client_bridge.h" | 5 #include "android_webview/native/aw_contents_client_bridge.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "android_webview/common/devtools_instrumentation.h" | 9 #include "android_webview/common/devtools_instrumentation.h" |
| 10 #include "android_webview/native/aw_contents.h" | 10 #include "android_webview/native/aw_contents.h" |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 return false; | 350 return false; |
| 351 ScopedJavaLocalRef<jstring> jurl = ConvertUTF16ToJavaString(env, url); | 351 ScopedJavaLocalRef<jstring> jurl = ConvertUTF16ToJavaString(env, url); |
| 352 devtools_instrumentation::ScopedEmbedderCallbackTask( | 352 devtools_instrumentation::ScopedEmbedderCallbackTask( |
| 353 "shouldOverrideUrlLoading"); | 353 "shouldOverrideUrlLoading"); |
| 354 bool did_override = Java_AwContentsClientBridge_shouldOverrideUrlLoading( | 354 bool did_override = Java_AwContentsClientBridge_shouldOverrideUrlLoading( |
| 355 env, obj, jurl, has_user_gesture, is_redirect, is_main_frame); | 355 env, obj, jurl, has_user_gesture, is_redirect, is_main_frame); |
| 356 if (HasException(env)) { | 356 if (HasException(env)) { |
| 357 // Tell the chromium message loop to not perform any tasks after the current | 357 // Tell the chromium message loop to not perform any tasks after the current |
| 358 // one - we want to make sure we return to Java cleanly without first making | 358 // one - we want to make sure we return to Java cleanly without first making |
| 359 // any new JNI calls. | 359 // any new JNI calls. |
| 360 static_cast<base::MessageLoopForUI*>(base::MessageLoop::current())->Abort(); | 360 base::MessageLoopForUI::current()->Abort(); |
| 361 // If we crashed we don't want to continue the navigation. | 361 // If we crashed we don't want to continue the navigation. |
| 362 return true; | 362 return true; |
| 363 } | 363 } |
| 364 return did_override; | 364 return did_override; |
| 365 } | 365 } |
| 366 | 366 |
| 367 void AwContentsClientBridge::ConfirmJsResult(JNIEnv* env, | 367 void AwContentsClientBridge::ConfirmJsResult(JNIEnv* env, |
| 368 const JavaRef<jobject>&, | 368 const JavaRef<jobject>&, |
| 369 int id, | 369 int id, |
| 370 const JavaRef<jstring>& prompt) { | 370 const JavaRef<jstring>& prompt) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 pending_client_cert_request_delegates_.Remove(request_id); | 405 pending_client_cert_request_delegates_.Remove(request_id); |
| 406 | 406 |
| 407 delete delegate; | 407 delete delegate; |
| 408 } | 408 } |
| 409 | 409 |
| 410 bool RegisterAwContentsClientBridge(JNIEnv* env) { | 410 bool RegisterAwContentsClientBridge(JNIEnv* env) { |
| 411 return RegisterNativesImpl(env); | 411 return RegisterNativesImpl(env); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace android_webview | 414 } // namespace android_webview |
| OLD | NEW |