OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_proxy.h" | 5 #include "content/browser/android/web_contents_observer_proxy.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 } | 289 } |
290 | 290 |
291 void WebContentsObserverProxy::DidFirstVisuallyNonEmptyPaint() { | 291 void WebContentsObserverProxy::DidFirstVisuallyNonEmptyPaint() { |
292 JNIEnv* env = AttachCurrentThread(); | 292 JNIEnv* env = AttachCurrentThread(); |
293 ScopedJavaLocalRef<jobject> obj(java_observer_); | 293 ScopedJavaLocalRef<jobject> obj(java_observer_); |
294 Java_WebContentsObserverProxy_didFirstVisuallyNonEmptyPaint(env, obj); | 294 Java_WebContentsObserverProxy_didFirstVisuallyNonEmptyPaint(env, obj); |
295 } | 295 } |
296 | 296 |
297 void WebContentsObserverProxy::DidStartNavigationToPendingEntry( | 297 void WebContentsObserverProxy::DidStartNavigationToPendingEntry( |
298 const GURL& url, | 298 const GURL& url, |
299 NavigationController::ReloadType reload_type) { | 299 ReloadType reload_type) { |
300 JNIEnv* env = AttachCurrentThread(); | 300 JNIEnv* env = AttachCurrentThread(); |
301 ScopedJavaLocalRef<jobject> obj(java_observer_); | 301 ScopedJavaLocalRef<jobject> obj(java_observer_); |
302 ScopedJavaLocalRef<jstring> jstring_url( | 302 ScopedJavaLocalRef<jstring> jstring_url( |
303 ConvertUTF8ToJavaString(env, url.spec())); | 303 ConvertUTF8ToJavaString(env, url.spec())); |
304 | 304 |
305 Java_WebContentsObserverProxy_didStartNavigationToPendingEntry(env, obj, | 305 Java_WebContentsObserverProxy_didStartNavigationToPendingEntry(env, obj, |
306 jstring_url); | 306 jstring_url); |
307 } | 307 } |
308 | 308 |
309 void WebContentsObserverProxy::MediaSessionStateChanged( | 309 void WebContentsObserverProxy::MediaSessionStateChanged( |
(...skipping 26 matching lines...) Expand all Loading... |
336 // a base URL if there has been a loadUrl("javascript:...") after | 336 // a base URL if there has been a loadUrl("javascript:...") after |
337 // loadDataWithBaseUrl. | 337 // loadDataWithBaseUrl. |
338 *url = base_url_of_last_started_data_url_.possibly_invalid_spec(); | 338 *url = base_url_of_last_started_data_url_.possibly_invalid_spec(); |
339 } | 339 } |
340 } | 340 } |
341 | 341 |
342 bool RegisterWebContentsObserverProxy(JNIEnv* env) { | 342 bool RegisterWebContentsObserverProxy(JNIEnv* env) { |
343 return RegisterNativesImpl(env); | 343 return RegisterNativesImpl(env); |
344 } | 344 } |
345 } // namespace content | 345 } // namespace content |
OLD | NEW |