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

Unified Diff: android_webview/native/aw_contents.cc

Issue 12091111: Implement Webviewclient.onReceivedSslError (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review from joth Created 7 years, 10 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: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 7b429f23f0e51d0726b03870bc7aafd24b83a32e..73903b7937d55282925e56b232b022a04358c0c8 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -15,6 +15,7 @@
#include "android_webview/common/aw_hit_test_data.h"
#include "android_webview/common/renderer_picture_map.h"
#include "android_webview/native/aw_browser_dependency_factory.h"
+#include "android_webview/native/aw_contents_client_bridge.h"
#include "android_webview/native/aw_contents_io_thread_client_impl.h"
#include "android_webview/native/aw_web_contents_delegate.h"
#include "android_webview/native/state_serializer.h"
@@ -176,10 +177,13 @@ AwContents* AwContents::FromID(int render_process_id, int render_view_id) {
AwContents::AwContents(JNIEnv* env,
jobject obj,
- jobject web_contents_delegate)
+ jobject web_contents_delegate,
+ jobject contents_client_bridge)
: java_ref_(env, obj),
web_contents_delegate_(
new AwWebContentsDelegate(env, web_contents_delegate)),
+ contents_client_bridge_(
+ new AwContentsClientBridge(env, contents_client_bridge)),
view_visible_(false),
compositor_visible_(false),
is_composite_pending_(false),
@@ -211,6 +215,10 @@ void AwContents::SetWebContents(content::WebContents* web_contents) {
icon_helper_->SetListener(this);
web_contents_->SetUserData(kAwContentsUserDataKey,
new AwContentsUserData(this));
+ web_contents_->SetUserData(
+ AwCertificateErrorHandlerBase::UserData::kAwCertificateErrorHandlerBase,
+ new AwCertificateErrorHandlerBase::UserData(
+ contents_client_bridge_.get()));
joth 2013/02/22 23:12:41 yeah this will be much cleaner as: AwCertificateEr
sgurun-gerrit only 2013/02/23 00:16:14 Done.
web_contents_->SetDelegate(web_contents_delegate_.get());
render_view_host_ext_.reset(new AwRenderViewHostExt(web_contents_.get(),
@@ -671,11 +679,14 @@ void AwContents::OnReceivedHttpAuthRequest(const JavaRef<jobject>& handler,
const std::string& host,
const std::string& realm) {
JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
+ if (obj.is_null())
+ return;
+
ScopedJavaLocalRef<jstring> jhost = ConvertUTF8ToJavaString(env, host);
ScopedJavaLocalRef<jstring> jrealm = ConvertUTF8ToJavaString(env, realm);
- Java_AwContents_onReceivedHttpAuthRequest(env, java_ref_.get(env).obj(),
- handler.obj(), jhost.obj(),
- jrealm.obj());
+ Java_AwContents_onReceivedHttpAuthRequest(env, obj.obj(), handler.obj(),
+ jhost.obj(), jrealm.obj());
}
void AwContents::SetIoThreadClient(JNIEnv* env, jobject obj, jobject client) {
@@ -717,8 +728,10 @@ void AwContents::AddVisitedLinks(JNIEnv* env,
static jint Init(JNIEnv* env,
jobject obj,
- jobject web_contents_delegate) {
- AwContents* tab = new AwContents(env, obj, web_contents_delegate);
+ jobject web_contents_delegate,
+ jobject contents_client_bridge) {
+ AwContents* tab = new AwContents(env, obj, web_contents_delegate,
+ contents_client_bridge);
return reinterpret_cast<jint>(tab);
}

Powered by Google App Engine
This is Rietveld 408576698