| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 NavigationController::ReloadType reload_type) { | 281 NavigationController::ReloadType reload_type) { |
| 282 JNIEnv* env = AttachCurrentThread(); | 282 JNIEnv* env = AttachCurrentThread(); |
| 283 ScopedJavaLocalRef<jobject> obj(java_observer_); | 283 ScopedJavaLocalRef<jobject> obj(java_observer_); |
| 284 ScopedJavaLocalRef<jstring> jstring_url( | 284 ScopedJavaLocalRef<jstring> jstring_url( |
| 285 ConvertUTF8ToJavaString(env, url.spec())); | 285 ConvertUTF8ToJavaString(env, url.spec())); |
| 286 | 286 |
| 287 Java_WebContentsObserverProxy_didStartNavigationToPendingEntry( | 287 Java_WebContentsObserverProxy_didStartNavigationToPendingEntry( |
| 288 env, obj.obj(), jstring_url.obj()); | 288 env, obj.obj(), jstring_url.obj()); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void WebContentsObserverProxy::MediaSessionStateChanged(bool is_controllable, |
| 292 bool is_suspended) { |
| 293 JNIEnv* env = AttachCurrentThread(); |
| 294 |
| 295 ScopedJavaLocalRef<jobject> obj(java_observer_); |
| 296 |
| 297 Java_WebContentsObserverProxy_mediaSessionStateChanged( |
| 298 env, obj.obj(), is_controllable, is_suspended); |
| 299 } |
| 300 |
| 291 bool RegisterWebContentsObserverProxy(JNIEnv* env) { | 301 bool RegisterWebContentsObserverProxy(JNIEnv* env) { |
| 292 return RegisterNativesImpl(env); | 302 return RegisterNativesImpl(env); |
| 293 } | 303 } |
| 294 } // namespace content | 304 } // namespace content |
| OLD | NEW |