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

Side by Side Diff: content/browser/frame_host/render_frame_host_android.h

Issue 2681933002: Add Java wrapper for RenderFrameHost (Closed)
Patch Set: Add getMainFrame API and test it Created 3 years, 10 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
(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_ANDROID_H_
6 #define CONTENT_BROWSER_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/scoped_java_ref.h"
14 #include "base/compiler_specific.h"
15 #include "base/macros.h"
16 #include "base/memory/weak_ptr.h"
17 #include "content/common/content_export.h"
18
19 namespace content {
20
21 class RenderFrameHostImpl;
22
23 // Android wrapper around RenderFrameHost that provides safer passage from java
24 // and
please use gerrit instead 2017/02/14 18:31:10 reflow please
rwlbuis 2017/02/14 19:26:27 Done.
25 // back to native and provides java with a means of communicating with its
26 // native counterpart.
27 class CONTENT_EXPORT RenderFrameHostAndroid {
28 public:
29 static bool Register(JNIEnv* env);
30
31 explicit RenderFrameHostAndroid(RenderFrameHostImpl* render_frame_host);
32 ~RenderFrameHostAndroid();
33
34 RenderFrameHostImpl* render_frame_host() const { return render_frame_host_; }
35
36 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
37
38 // Methods called from Java
39 base::android::ScopedJavaLocalRef<jstring> GetURL(
40 JNIEnv* env,
41 const base::android::JavaParamRef<jobject>&) const;
42
43 private:
44 RenderFrameHostImpl* render_frame_host_;
45 base::android::ScopedJavaGlobalRef<jobject> obj_;
46
47 base::WeakPtrFactory<RenderFrameHostAndroid> weak_factory_;
48
49 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostAndroid);
50 };
51
52 } // namespace content
53
54 #endif // CONTENT_BROWSER_FRAME_HOST_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698