OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/android/web_contents_observer_android.h" | 5 #include "content/browser/android/web_contents_observer_android.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include <jni.h> | 9 #include <jni.h> |
10 | 10 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 JNIEnv* env = AttachCurrentThread(); | 164 JNIEnv* env = AttachCurrentThread(); |
165 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); | 165 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); |
166 if (obj.is_null()) | 166 if (obj.is_null()) |
167 return; | 167 return; |
168 ScopedJavaLocalRef<jstring> jstring_url( | 168 ScopedJavaLocalRef<jstring> jstring_url( |
169 ConvertUTF8ToJavaString(env, validated_url.spec())); | 169 ConvertUTF8ToJavaString(env, validated_url.spec())); |
170 Java_WebContentsObserverAndroid_didFinishLoad( | 170 Java_WebContentsObserverAndroid_didFinishLoad( |
171 env, obj.obj(), frame_id, jstring_url.obj(), is_main_frame); | 171 env, obj.obj(), frame_id, jstring_url.obj(), is_main_frame); |
172 } | 172 } |
173 | 173 |
| 174 void WebContentsObserverAndroid::DidChangeVisibleSSLState() { |
| 175 JNIEnv* env = AttachCurrentThread(); |
| 176 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); |
| 177 if (obj.is_null()) |
| 178 return; |
| 179 Java_WebContentsObserverAndroid_didChangeVisibleSSLState(env, obj.obj()); |
| 180 } |
| 181 |
174 void WebContentsObserverAndroid::DidFailLoadInternal( | 182 void WebContentsObserverAndroid::DidFailLoadInternal( |
175 bool is_provisional_load, | 183 bool is_provisional_load, |
176 bool is_main_frame, | 184 bool is_main_frame, |
177 int error_code, | 185 int error_code, |
178 const string16& description, | 186 const string16& description, |
179 const GURL& url) { | 187 const GURL& url) { |
180 JNIEnv* env = AttachCurrentThread(); | 188 JNIEnv* env = AttachCurrentThread(); |
181 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); | 189 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); |
182 if (obj.is_null()) | 190 if (obj.is_null()) |
183 return; | 191 return; |
(...skipping 11 matching lines...) Expand all Loading... |
195 } | 203 } |
196 | 204 |
197 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { | 205 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { |
198 if (!HasClass(env, kWebContentsObserverAndroidClassPath)) { | 206 if (!HasClass(env, kWebContentsObserverAndroidClassPath)) { |
199 DLOG(ERROR) << "Unable to find class WebContentsObserverAndroid!"; | 207 DLOG(ERROR) << "Unable to find class WebContentsObserverAndroid!"; |
200 return false; | 208 return false; |
201 } | 209 } |
202 return RegisterNativesImpl(env); | 210 return RegisterNativesImpl(env); |
203 } | 211 } |
204 } // namespace content | 212 } // namespace content |
OLD | NEW |