OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/web_contents/web_contents_android.h" | 5 #include "content/browser/web_contents/web_contents_android.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 g_allocated_web_contents_androids.Get().end()); | 277 g_allocated_web_contents_androids.Get().end()); |
278 g_allocated_web_contents_androids.Get().erase(this); | 278 g_allocated_web_contents_androids.Get().erase(this); |
279 Java_WebContentsImpl_clearNativePtr(AttachCurrentThread(), obj_); | 279 Java_WebContentsImpl_clearNativePtr(AttachCurrentThread(), obj_); |
280 } | 280 } |
281 | 281 |
282 base::android::ScopedJavaLocalRef<jobject> | 282 base::android::ScopedJavaLocalRef<jobject> |
283 WebContentsAndroid::GetJavaObject() { | 283 WebContentsAndroid::GetJavaObject() { |
284 return base::android::ScopedJavaLocalRef<jobject>(obj_); | 284 return base::android::ScopedJavaLocalRef<jobject>(obj_); |
285 } | 285 } |
286 | 286 |
| 287 ScopedJavaLocalRef<jobject> WebContentsAndroid::GetMainFrame( |
| 288 JNIEnv* env, |
| 289 const JavaParamRef<jobject>& obj) const { |
| 290 return web_contents_->GetMainFrame()->GetJavaRenderFrameHost(); |
| 291 } |
| 292 |
287 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetTitle( | 293 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetTitle( |
288 JNIEnv* env, | 294 JNIEnv* env, |
289 const JavaParamRef<jobject>& obj) const { | 295 const JavaParamRef<jobject>& obj) const { |
290 return base::android::ConvertUTF16ToJavaString(env, | 296 return base::android::ConvertUTF16ToJavaString(env, |
291 web_contents_->GetTitle()); | 297 web_contents_->GetTitle()); |
292 } | 298 } |
293 | 299 |
294 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetVisibleURL( | 300 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetVisibleURL( |
295 JNIEnv* env, | 301 JNIEnv* env, |
296 const JavaParamRef<jobject>& obj) const { | 302 const JavaParamRef<jobject>& obj) const { |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); | 766 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); |
761 } | 767 } |
762 | 768 |
763 void WebContentsAndroid::SetMediaSession( | 769 void WebContentsAndroid::SetMediaSession( |
764 const ScopedJavaLocalRef<jobject>& j_media_session) { | 770 const ScopedJavaLocalRef<jobject>& j_media_session) { |
765 JNIEnv* env = base::android::AttachCurrentThread(); | 771 JNIEnv* env = base::android::AttachCurrentThread(); |
766 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); | 772 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); |
767 } | 773 } |
768 | 774 |
769 } // namespace content | 775 } // namespace content |
OLD | NEW |