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 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // Android wrapper around WebContents that provides safer passage from java and | 26 // Android wrapper around WebContents that provides safer passage from java and |
27 // back to native and provides java with a means of communicating with its | 27 // back to native and provides java with a means of communicating with its |
28 // native counterpart. | 28 // native counterpart. |
29 class CONTENT_EXPORT WebContentsAndroid | 29 class CONTENT_EXPORT WebContentsAndroid |
30 : public base::SupportsUserData::Data { | 30 : public base::SupportsUserData::Data { |
31 public: | 31 public: |
32 static bool Register(JNIEnv* env); | 32 static bool Register(JNIEnv* env); |
33 | 33 |
34 explicit WebContentsAndroid(WebContents* web_contents); | 34 explicit WebContentsAndroid(WebContents* web_contents); |
35 virtual ~WebContentsAndroid(); | 35 ~WebContentsAndroid() override; |
36 | 36 |
37 WebContents* web_contents() const { return web_contents_; } | 37 WebContents* web_contents() const { return web_contents_; } |
38 | 38 |
39 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); | 39 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); |
40 | 40 |
41 // Methods called from Java | 41 // Methods called from Java |
42 base::android::ScopedJavaLocalRef<jstring> GetTitle(JNIEnv* env, | 42 base::android::ScopedJavaLocalRef<jstring> GetTitle(JNIEnv* env, |
43 jobject obj) const; | 43 jobject obj) const; |
44 base::android::ScopedJavaLocalRef<jstring> GetVisibleURL(JNIEnv* env, | 44 base::android::ScopedJavaLocalRef<jstring> GetVisibleURL(JNIEnv* env, |
45 jobject obj) const; | 45 jobject obj) const; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 base::android::ScopedJavaGlobalRef<jobject> obj_; | 123 base::android::ScopedJavaGlobalRef<jobject> obj_; |
124 | 124 |
125 base::WeakPtrFactory<WebContentsAndroid> weak_factory_; | 125 base::WeakPtrFactory<WebContentsAndroid> weak_factory_; |
126 | 126 |
127 DISALLOW_COPY_AND_ASSIGN(WebContentsAndroid); | 127 DISALLOW_COPY_AND_ASSIGN(WebContentsAndroid); |
128 }; | 128 }; |
129 | 129 |
130 } // namespace content | 130 } // namespace content |
131 | 131 |
132 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ | 132 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_ANDROID_H_ |
OLD | NEW |