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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // Note that GetBaseURLForDataURL is only used by the Android WebView. | 209 // Note that GetBaseURLForDataURL is only used by the Android WebView. |
210 if (entry && !entry->GetBaseURLForDataURL().is_empty()) | 210 if (entry && !entry->GetBaseURLForDataURL().is_empty()) |
211 url_string = entry->GetBaseURLForDataURL().possibly_invalid_spec(); | 211 url_string = entry->GetBaseURLForDataURL().possibly_invalid_spec(); |
212 | 212 |
213 ScopedJavaLocalRef<jstring> jstring_url( | 213 ScopedJavaLocalRef<jstring> jstring_url( |
214 ConvertUTF8ToJavaString(env, url_string)); | 214 ConvertUTF8ToJavaString(env, url_string)); |
215 Java_WebContentsObserverAndroid_didFinishLoad( | 215 Java_WebContentsObserverAndroid_didFinishLoad( |
216 env, obj.obj(), frame_id, jstring_url.obj(), is_main_frame); | 216 env, obj.obj(), frame_id, jstring_url.obj(), is_main_frame); |
217 } | 217 } |
218 | 218 |
| 219 void WebContentsObserverAndroid::DocumentLoadedInFrame( |
| 220 int64 frame_id, |
| 221 RenderViewHost* render_view_host) { |
| 222 JNIEnv* env = AttachCurrentThread(); |
| 223 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); |
| 224 if (obj.is_null()) |
| 225 return; |
| 226 Java_WebContentsObserverAndroid_documentLoadedInFrame( |
| 227 env, obj.obj(), frame_id); |
| 228 } |
| 229 |
219 void WebContentsObserverAndroid::NavigationEntryCommitted( | 230 void WebContentsObserverAndroid::NavigationEntryCommitted( |
220 const LoadCommittedDetails& load_details) { | 231 const LoadCommittedDetails& load_details) { |
221 JNIEnv* env = AttachCurrentThread(); | 232 JNIEnv* env = AttachCurrentThread(); |
222 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); | 233 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); |
223 if (obj.is_null()) | 234 if (obj.is_null()) |
224 return; | 235 return; |
225 Java_WebContentsObserverAndroid_navigationEntryCommitted(env, obj.obj()); | 236 Java_WebContentsObserverAndroid_navigationEntryCommitted(env, obj.obj()); |
226 } | 237 } |
227 | 238 |
228 void WebContentsObserverAndroid::DidChangeVisibleSSLState() { | 239 void WebContentsObserverAndroid::DidChangeVisibleSSLState() { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 if (obj.is_null()) | 289 if (obj.is_null()) |
279 return; | 290 return; |
280 Java_WebContentsObserverAndroid_didFirstVisuallyNonEmptyPaint( | 291 Java_WebContentsObserverAndroid_didFirstVisuallyNonEmptyPaint( |
281 env, obj.obj()); | 292 env, obj.obj()); |
282 } | 293 } |
283 | 294 |
284 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { | 295 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { |
285 return RegisterNativesImpl(env); | 296 return RegisterNativesImpl(env); |
286 } | 297 } |
287 } // namespace content | 298 } // namespace content |
OLD | NEW |