OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 6 #define ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
(...skipping 12 matching lines...) Expand all Loading... | |
23 class TabContents; | 23 class TabContents; |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 class WebContents; | 26 class WebContents; |
27 } | 27 } |
28 | 28 |
29 namespace android_webview { | 29 namespace android_webview { |
30 | 30 |
31 class AwContentsContainer; | 31 class AwContentsContainer; |
32 class AwContentsClientBridge; | 32 class AwContentsClientBridge; |
33 class AwPdfExporter; | |
33 class AwWebContentsDelegate; | 34 class AwWebContentsDelegate; |
34 | 35 |
35 // Native side of java-class of same name. | 36 // Native side of java-class of same name. |
36 // Provides the ownership of and access to browser components required for | 37 // Provides the ownership of and access to browser components required for |
37 // WebView functionality; analogous to chrome's TabContents, but with a | 38 // WebView functionality; analogous to chrome's TabContents, but with a |
38 // level of indirection provided by the AwContentsContainer abstraction. | 39 // level of indirection provided by the AwContentsContainer abstraction. |
39 // | 40 // |
40 // Object lifetime: | 41 // Object lifetime: |
41 // For most purposes the java and native objects can be considered to have | 42 // For most purposes the java and native objects can be considered to have |
42 // 1:1 lifetime and relationship. The exception is the java instance that | 43 // 1:1 lifetime and relationship. The exception is the java instance that |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 jobject web_contents_delegate, | 78 jobject web_contents_delegate, |
78 jobject contents_client_bridge, | 79 jobject contents_client_bridge, |
79 jobject io_thread_client, | 80 jobject io_thread_client, |
80 jobject intercept_navigation_delegate); | 81 jobject intercept_navigation_delegate); |
81 jint GetWebContents(JNIEnv* env, jobject obj); | 82 jint GetWebContents(JNIEnv* env, jobject obj); |
82 jint GetAwContentsClientBridge(JNIEnv* env, jobject obj); | 83 jint GetAwContentsClientBridge(JNIEnv* env, jobject obj); |
83 | 84 |
84 void Destroy(JNIEnv* env, jobject obj); | 85 void Destroy(JNIEnv* env, jobject obj); |
85 void DocumentHasImages(JNIEnv* env, jobject obj, jobject message); | 86 void DocumentHasImages(JNIEnv* env, jobject obj, jobject message); |
86 void GenerateMHTML(JNIEnv* env, jobject obj, jstring jpath, jobject callback); | 87 void GenerateMHTML(JNIEnv* env, jobject obj, jstring jpath, jobject callback); |
88 void CreatePdfExporter(JNIEnv* env, jobject obj, jobject pdfExporter); | |
89 public: | |
joth
2013/11/21 19:38:03
remove me
sgurun-gerrit only
2013/11/23 01:49:11
Done.
| |
87 void AddVisitedLinks(JNIEnv* env, jobject obj, jobjectArray jvisited_links); | 90 void AddVisitedLinks(JNIEnv* env, jobject obj, jobjectArray jvisited_links); |
88 base::android::ScopedJavaLocalRef<jbyteArray> GetCertificate( | 91 base::android::ScopedJavaLocalRef<jbyteArray> GetCertificate( |
89 JNIEnv* env, jobject obj); | 92 JNIEnv* env, jobject obj); |
90 void RequestNewHitTestDataAt(JNIEnv* env, jobject obj, jint x, jint y); | 93 void RequestNewHitTestDataAt(JNIEnv* env, jobject obj, jint x, jint y); |
91 void UpdateLastHitTestData(JNIEnv* env, jobject obj); | 94 void UpdateLastHitTestData(JNIEnv* env, jobject obj); |
92 void OnSizeChanged(JNIEnv* env, jobject obj, int w, int h, int ow, int oh); | 95 void OnSizeChanged(JNIEnv* env, jobject obj, int w, int h, int ow, int oh); |
93 void SetViewVisibility(JNIEnv* env, jobject obj, bool visible); | 96 void SetViewVisibility(JNIEnv* env, jobject obj, bool visible); |
94 void SetWindowVisibility(JNIEnv* env, jobject obj, bool visible); | 97 void SetWindowVisibility(JNIEnv* env, jobject obj, bool visible); |
95 void SetIsPaused(JNIEnv* env, jobject obj, bool paused); | 98 void SetIsPaused(JNIEnv* env, jobject obj, bool paused); |
96 void OnAttachedToWindow(JNIEnv* env, jobject obj, int w, int h); | 99 void OnAttachedToWindow(JNIEnv* env, jobject obj, int w, int h); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 | 192 |
190 JavaObjectWeakGlobalRef java_ref_; | 193 JavaObjectWeakGlobalRef java_ref_; |
191 scoped_ptr<content::WebContents> web_contents_; | 194 scoped_ptr<content::WebContents> web_contents_; |
192 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; | 195 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; |
193 scoped_ptr<AwContentsClientBridge> contents_client_bridge_; | 196 scoped_ptr<AwContentsClientBridge> contents_client_bridge_; |
194 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; | 197 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; |
195 scoped_ptr<FindHelper> find_helper_; | 198 scoped_ptr<FindHelper> find_helper_; |
196 scoped_ptr<IconHelper> icon_helper_; | 199 scoped_ptr<IconHelper> icon_helper_; |
197 scoped_ptr<AwContents> pending_contents_; | 200 scoped_ptr<AwContents> pending_contents_; |
198 scoped_ptr<BrowserViewRenderer> browser_view_renderer_; | 201 scoped_ptr<BrowserViewRenderer> browser_view_renderer_; |
202 scoped_ptr<AwPdfExporter> pdf_exporter_; | |
199 | 203 |
200 // GURL is supplied by the content layer as requesting frame. | 204 // GURL is supplied by the content layer as requesting frame. |
201 // Callback is supplied by the content layer, and is invoked with the result | 205 // Callback is supplied by the content layer, and is invoked with the result |
202 // from the permission prompt. | 206 // from the permission prompt. |
203 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; | 207 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; |
204 // The first element in the list is always the currently pending request. | 208 // The first element in the list is always the currently pending request. |
205 std::list<OriginCallback> pending_geolocation_prompts_; | 209 std::list<OriginCallback> pending_geolocation_prompts_; |
206 | 210 |
207 DISALLOW_COPY_AND_ASSIGN(AwContents); | 211 DISALLOW_COPY_AND_ASSIGN(AwContents); |
208 }; | 212 }; |
209 | 213 |
210 bool RegisterAwContents(JNIEnv* env); | 214 bool RegisterAwContents(JNIEnv* env); |
211 | 215 |
212 } // namespace android_webview | 216 } // namespace android_webview |
213 | 217 |
214 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 218 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
OLD | NEW |