Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: content/browser/web_contents/web_contents_android.cc

Issue 2681933002: Add Java wrapper for RenderFrameHost (Closed)
Patch Set: Make test work with PlzNavigate Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes); 772 env, obj, callback, id, http_status_code, jurl, jbitmaps, jsizes);
767 } 773 }
768 774
769 void WebContentsAndroid::SetMediaSession( 775 void WebContentsAndroid::SetMediaSession(
770 const ScopedJavaLocalRef<jobject>& j_media_session) { 776 const ScopedJavaLocalRef<jobject>& j_media_session) {
771 JNIEnv* env = base::android::AttachCurrentThread(); 777 JNIEnv* env = base::android::AttachCurrentThread();
772 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session); 778 Java_WebContentsImpl_setMediaSession(env, obj_, j_media_session);
773 } 779 }
774 780
775 } // namespace content 781 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_android.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698