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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 287 |
288 base::android::ScopedJavaLocalRef<jobject> | 288 base::android::ScopedJavaLocalRef<jobject> |
289 WebContentsAndroid::GetTopLevelNativeWindow(JNIEnv* env, | 289 WebContentsAndroid::GetTopLevelNativeWindow(JNIEnv* env, |
290 const JavaParamRef<jobject>& obj) { | 290 const JavaParamRef<jobject>& obj) { |
291 ui::WindowAndroid* window_android = web_contents_->GetTopLevelNativeWindow(); | 291 ui::WindowAndroid* window_android = web_contents_->GetTopLevelNativeWindow(); |
292 if (!window_android) | 292 if (!window_android) |
293 return nullptr; | 293 return nullptr; |
294 return window_android->GetJavaObject(); | 294 return window_android->GetJavaObject(); |
295 } | 295 } |
296 | 296 |
| 297 ScopedJavaLocalRef<jobject> WebContentsAndroid::GetMainFrame( |
| 298 JNIEnv* env, |
| 299 const JavaParamRef<jobject>& obj) const { |
| 300 return web_contents_->GetMainFrame()->GetJavaRenderFrameHost(); |
| 301 } |
| 302 |
297 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetTitle( | 303 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetTitle( |
298 JNIEnv* env, | 304 JNIEnv* env, |
299 const JavaParamRef<jobject>& obj) const { | 305 const JavaParamRef<jobject>& obj) const { |
300 return base::android::ConvertUTF16ToJavaString(env, | 306 return base::android::ConvertUTF16ToJavaString(env, |
301 web_contents_->GetTitle()); | 307 web_contents_->GetTitle()); |
302 } | 308 } |
303 | 309 |
304 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetVisibleURL( | 310 ScopedJavaLocalRef<jstring> WebContentsAndroid::GetVisibleURL( |
305 JNIEnv* env, | 311 JNIEnv* env, |
306 const JavaParamRef<jobject>& obj) const { | 312 const JavaParamRef<jobject>& obj) const { |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); | 765 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); |
760 } | 766 } |
761 | 767 |
762 void WebContentsAndroid::SetMediaSession( | 768 void WebContentsAndroid::SetMediaSession( |
763 const ScopedJavaLocalRef<jobject>& j_media_session) { | 769 const ScopedJavaLocalRef<jobject>& j_media_session) { |
764 JNIEnv* env = base::android::AttachCurrentThread(); | 770 JNIEnv* env = base::android::AttachCurrentThread(); |
765 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); | 771 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); |
766 } | 772 } |
767 | 773 |
768 } // namespace content | 774 } // namespace content |
OLD | NEW |