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

Unified Diff: android_webview/native/aw_contents_io_thread_client_impl.cc

Issue 12620004: [android_webview] Fake onReceivedError callback for intercepted navigations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make findbugs happy Created 7 years, 9 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
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents_io_thread_client_impl.cc
diff --git a/android_webview/native/aw_contents_io_thread_client_impl.cc b/android_webview/native/aw_contents_io_thread_client_impl.cc
index 0251cefb7497a6ee4d30b306fc4917a18e4892f7..de8f1b1a9da3cab0732bb4de17a673effd6a261a 100644
--- a/android_webview/native/aw_contents_io_thread_client_impl.cc
+++ b/android_webview/native/aw_contents_io_thread_client_impl.cc
@@ -17,6 +17,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/resource_request_info.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "googleurl/src/gurl.h"
@@ -195,13 +196,16 @@ AwContentsIoThreadClientImpl::ShouldInterceptRequest(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (java_object_.is_null())
return scoped_ptr<InterceptedRequestData>();
+ const content::ResourceRequestInfo* info =
+ content::ResourceRequestInfo::ForRequest(request);
+ bool is_main_frame = info && info->IsMainFrame();
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jstring> jstring_url =
ConvertUTF8ToJavaString(env, location.spec());
ScopedJavaLocalRef<jobject> ret =
Java_AwContentsIoThreadClient_shouldInterceptRequest(
- env, java_object_.obj(), jstring_url.obj());
+ env, java_object_.obj(), jstring_url.obj(), is_main_frame);
if (ret.is_null())
return scoped_ptr<InterceptedRequestData>();
return scoped_ptr<InterceptedRequestData>(
« no previous file with comments | « android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientShouldInterceptRequestTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698