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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 328 |
329 void WebContentsObserverAndroid::DidFirstVisuallyNonEmptyPaint() { | 329 void WebContentsObserverAndroid::DidFirstVisuallyNonEmptyPaint() { |
330 JNIEnv* env = AttachCurrentThread(); | 330 JNIEnv* env = AttachCurrentThread(); |
331 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); | 331 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); |
332 if (obj.is_null()) | 332 if (obj.is_null()) |
333 return; | 333 return; |
334 Java_WebContentsObserver_didFirstVisuallyNonEmptyPaint( | 334 Java_WebContentsObserver_didFirstVisuallyNonEmptyPaint( |
335 env, obj.obj()); | 335 env, obj.obj()); |
336 } | 336 } |
337 | 337 |
| 338 void WebContentsObserverAndroid::DidStartNavigationToPendingEntry( |
| 339 const GURL& url, |
| 340 NavigationController::ReloadType reload_type) { |
| 341 JNIEnv* env = AttachCurrentThread(); |
| 342 ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); |
| 343 if (obj.is_null()) |
| 344 return; |
| 345 ScopedJavaLocalRef<jstring> jstring_url( |
| 346 ConvertUTF8ToJavaString(env, url.spec())); |
| 347 |
| 348 Java_WebContentsObserver_didStartNavigationToPendingEntry( |
| 349 env, obj.obj(), jstring_url.obj(), reload_type); |
| 350 } |
| 351 |
338 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { | 352 bool RegisterWebContentsObserverAndroid(JNIEnv* env) { |
339 return RegisterNativesImpl(env); | 353 return RegisterNativesImpl(env); |
340 } | 354 } |
341 } // namespace content | 355 } // namespace content |
OLD | NEW |