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

Unified Diff: chrome/browser/android/chrome_web_contents_delegate_android.cc

Issue 10946008: Componentize IgnoreNavigationResourceThrottle and add chrome and webview specific implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months 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
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

Powered by Google App Engine
This is Rietveld 408576698