Index: content/browser/frame_host/render_frame_host_impl.cc |
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc |
index 944d444d2d9d16492223aa0b817f738e1876673d..b6086a04aecf9b994912f9ece06ffcad50fa5b49 100644 |
--- a/content/browser/frame_host/render_frame_host_impl.cc |
+++ b/content/browser/frame_host/render_frame_host_impl.cc |
@@ -112,8 +112,9 @@ |
#include "url/gurl.h" |
#if defined(OS_ANDROID) |
-#include "content/public/browser/android/java_interfaces.h" |
+#include "content/browser/frame_host/render_frame_host_android.h" |
#include "content/browser/media/android/media_player_renderer.h" |
+#include "content/public/browser/android/java_interfaces.h" |
#include "media/base/audio_renderer_sink.h" |
#include "media/base/video_renderer_sink.h" |
#include "media/mojo/services/mojo_renderer_service.h" // nogncheck |
@@ -135,6 +136,10 @@ namespace content { |
namespace { |
+#if defined(OS_ANDROID) |
+const void* const kRenderFrameHostAndroidKey = &kRenderFrameHostAndroidKey; |
+#endif // OS_ANDROID |
+ |
// The next value to use for the accessibility reset token. |
int g_next_accessibility_reset_token = 1; |
@@ -3462,4 +3467,18 @@ RenderFrameHostImpl::TakeNavigationHandleForCommit( |
entry_id_for_data_nav, false); // started_from_context_menu |
} |
+#if defined(OS_ANDROID) |
+base::android::ScopedJavaLocalRef<jobject> |
+RenderFrameHostImpl::GetJavaRenderFrameHost() { |
+ RenderFrameHostAndroid* render_frame_host_android = |
+ static_cast<RenderFrameHostAndroid*>( |
+ GetUserData(kRenderFrameHostAndroidKey)); |
+ if (!render_frame_host_android) { |
+ render_frame_host_android = new RenderFrameHostAndroid(this); |
+ SetUserData(kRenderFrameHostAndroidKey, render_frame_host_android); |
+ } |
+ return render_frame_host_android->GetJavaObject(); |
+} |
+#endif |
+ |
} // namespace content |