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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 ConvertUTF8ToJavaString(env, url.spec())); | 266 ConvertUTF8ToJavaString(env, url.spec())); |
267 | 267 |
268 Java_WebContentsObserverAndroid_didFailLoad( | 268 Java_WebContentsObserverAndroid_didFailLoad( |
269 env, obj.obj(), | 269 env, obj.obj(), |
270 is_provisional_load, | 270 is_provisional_load, |
271 is_main_frame, | 271 is_main_frame, |
272 error_code, | 272 error_code, |
273 jstring_error_description.obj(), jstring_url.obj()); | 273 jstring_error_description.obj(), jstring_url.obj()); |
274 } | 274 } |
275 | 275 |
276 void WebContentsObserverAndroid::DidFirstVisuallyNonEmptyPaint(int32 page_id) { | 276 void WebContentsObserverAndroid::DidFirstVisuallyNonEmptyPaint() { |
277 JNIEnv* env = AttachCurrentThread(); | 277 JNIEnv* env = AttachCurrentThread(); |
278 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); | 278 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); |
279 if (obj.is_null()) | 279 if (obj.is_null()) |
280 return; | 280 return; |
281 Java_WebContentsObserverAndroid_didFirstVisuallyNonEmptyPaint( | 281 Java_WebContentsObserverAndroid_didFirstVisuallyNonEmptyPaint( |
282 env, obj.obj(), page_id); | 282 env, obj.obj()); |
283 } | 283 } |
284 | 284 |
285 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { | 285 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { |
286 return RegisterNativesImpl(env); | 286 return RegisterNativesImpl(env); |
287 } | 287 } |
288 } // namespace content | 288 } // namespace content |
OLD | NEW |