OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_ANDROID_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include <memory> |
| 11 |
| 12 #include "base/android/jni_android.h" |
| 13 #include "base/android/jni_weak_ref.h" |
| 14 #include "base/android/scoped_java_ref.h" |
| 15 #include "base/compiler_specific.h" |
| 16 #include "base/macros.h" |
| 17 #include "base/supports_user_data.h" |
| 18 #include "content/common/content_export.h" |
| 19 |
| 20 namespace content { |
| 21 |
| 22 class RenderFrameHostImpl; |
| 23 |
| 24 // Android wrapper around RenderFrameHost that provides safer passage from java |
| 25 // and back to native and provides java with a means of communicating with its |
| 26 // native counterpart. |
| 27 class RenderFrameHostAndroid : public base::SupportsUserData::Data { |
| 28 public: |
| 29 static bool Register(JNIEnv* env); |
| 30 |
| 31 explicit RenderFrameHostAndroid(RenderFrameHostImpl* render_frame_host); |
| 32 ~RenderFrameHostAndroid() override; |
| 33 |
| 34 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); |
| 35 |
| 36 // Methods called from Java |
| 37 base::android::ScopedJavaLocalRef<jstring> GetLastCommittedURL( |
| 38 JNIEnv* env, |
| 39 const base::android::JavaParamRef<jobject>&) const; |
| 40 |
| 41 private: |
| 42 RenderFrameHostImpl* const render_frame_host_; |
| 43 JavaObjectWeakGlobalRef obj_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostAndroid); |
| 46 }; |
| 47 |
| 48 } // namespace content |
| 49 |
| 50 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_ANDROID_H_ |
OLD | NEW |