| Index: chrome/browser/android/chrome_web_contents_delegate_android.cc
|
| diff --git a/chrome/browser/android/chrome_web_contents_delegate_android.cc b/chrome/browser/android/chrome_web_contents_delegate_android.cc
|
| index 84d2685c1b1cd4fecc6e82b31a0a3d6f8e25b30e..d5d7ded7119ab4b82a54bd3e51575b8bb210c0aa 100644
|
| --- a/chrome/browser/android/chrome_web_contents_delegate_android.cc
|
| +++ b/chrome/browser/android/chrome_web_contents_delegate_android.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/android/chrome_web_contents_delegate_android.h"
|
|
|
| #include "base/android/jni_android.h"
|
| +#include "base/android/jni_string.h"
|
| #include "chrome/browser/file_select_helper.h"
|
| #include "chrome/browser/ui/find_bar/find_match_rects_details.h"
|
| #include "chrome/browser/ui/find_bar/find_notification_details.h"
|
| @@ -21,6 +22,7 @@
|
| #include "ui/gfx/rect_f.h"
|
|
|
| using base::android::AttachCurrentThread;
|
| +using base::android::ConvertUTF8ToJavaString;
|
| using base::android::GetClass;
|
| using base::android::ScopedJavaLocalRef;
|
| using content::FileChooserParams;
|
| @@ -229,5 +231,23 @@ void ChromeWebContentsDelegateAndroid::FindMatchRectsReply(
|
| details_object.obj());
|
| }
|
|
|
| +bool ChromeWebContentsDelegateAndroid::ShouldIgnoreNavigation(
|
| + const GURL& url,
|
| + bool is_content_initiated) {
|
| + if (!url.is_valid())
|
| + return false;
|
| +
|
| + JNIEnv* env = AttachCurrentThread();
|
| + ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
|
| + if (obj.is_null())
|
| + return false;
|
| +
|
| + ScopedJavaLocalRef<jstring> jstring_url =
|
| + ConvertUTF8ToJavaString(env, url.spec());
|
| + bool ret = Java_ChromeWebContentsDelegateAndroid_shouldIgnoreNavigation(
|
| + env, obj.obj(), jstring_url.obj(), is_content_initiated);
|
| + return ret;
|
| +}
|
| +
|
| } // namespace android
|
| } // namespace chrome
|
|
|