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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 g_allocated_web_contents_androids.Get().end()); | 278 g_allocated_web_contents_androids.Get().end()); |
279 g_allocated_web_contents_androids.Get().erase(this); | 279 g_allocated_web_contents_androids.Get().erase(this); |
280 Java_WebContentsImpl_clearNativePtr(AttachCurrentThread(), obj_); | 280 Java_WebContentsImpl_clearNativePtr(AttachCurrentThread(), obj_); |
281 } | 281 } |
282 | 282 |
283 base::android::ScopedJavaLocalRef<jobject> | 283 base::android::ScopedJavaLocalRef<jobject> |
284 WebContentsAndroid::GetJavaObject() { | 284 WebContentsAndroid::GetJavaObject() { |
285 return base::android::ScopedJavaLocalRef<jobject>(obj_); | 285 return base::android::ScopedJavaLocalRef<jobject>(obj_); |
286 } | 286 } |
287 | 287 |
| 288 ScopedJavaLocalRef<jobject> WebContentsAndroid::GetMainFrame( |
| 289 JNIEnv* env, |
| 290 const JavaParamRef<jobject>& obj) const { |
| 291 return web_contents_->GetMainFrame()->GetJavaRenderFrameHost(); |
| 292 } |
| 293 |
288 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetTitle( | 294 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetTitle( |
289 JNIEnv* env, | 295 JNIEnv* env, |
290 const JavaParamRef<jobject>& obj) const { | 296 const JavaParamRef<jobject>& obj) const { |
291 return base::android::ConvertUTF16ToJavaString(env, | 297 return base::android::ConvertUTF16ToJavaString(env, |
292 web_contents_->GetTitle()); | 298 web_contents_->GetTitle()); |
293 } | 299 } |
294 | 300 |
295 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetVisibleURL( | 301 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetVisibleURL( |
296 JNIEnv* env, | 302 JNIEnv* env, |
297 const JavaParamRef<jobject>& obj) const { | 303 const JavaParamRef<jobject>& obj) const { |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); | 769 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); |
764 } | 770 } |
765 | 771 |
766 void WebContentsAndroid::SetMediaSession( | 772 void WebContentsAndroid::SetMediaSession( |
767 const ScopedJavaLocalRef<jobject>& j_media_session) { | 773 const ScopedJavaLocalRef<jobject>& j_media_session) { |
768 JNIEnv* env = base::android::AttachCurrentThread(); | 774 JNIEnv* env = base::android::AttachCurrentThread(); |
769 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); | 775 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); |
770 } | 776 } |
771 | 777 |
772 } // namespace content | 778 } // namespace content |
OLD | NEW |