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 <string> | 10 #include <string> |
11 #include <utility> | |
10 | 12 |
11 #include "android_webview/browser/find_helper.h" | 13 #include "android_webview/browser/find_helper.h" |
12 #include "android_webview/browser/icon_helper.h" | 14 #include "android_webview/browser/icon_helper.h" |
13 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 15 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
14 #include "android_webview/public/browser/draw_gl.h" | 16 #include "android_webview/public/browser/draw_gl.h" |
15 #include "base/android/scoped_java_ref.h" | 17 #include "base/android/scoped_java_ref.h" |
16 #include "base/android/jni_helper.h" | 18 #include "base/android/jni_helper.h" |
19 #include "base/callback_forward.h" | |
17 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
18 #include "content/public/browser/android/compositor.h" | 21 #include "content/public/browser/android/compositor.h" |
19 #include "content/public/browser/javascript_dialog_manager.h" | 22 #include "content/public/browser/javascript_dialog_manager.h" |
20 #include "skia/ext/refptr.h" | 23 #include "skia/ext/refptr.h" |
21 #include "third_party/skia/include/core/SkPicture.h" | 24 #include "third_party/skia/include/core/SkPicture.h" |
22 | 25 |
23 typedef void* EGLContext; | 26 typedef void* EGLContext; |
24 class SkBitmap; | 27 class SkBitmap; |
25 class TabContents; | 28 class TabContents; |
26 | 29 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 int scroll_x, int scroll_y); | 127 int scroll_x, int scroll_y); |
125 void FocusFirstNode(JNIEnv* env, jobject obj); | 128 void FocusFirstNode(JNIEnv* env, jobject obj); |
126 base::android::ScopedJavaLocalRef<jobject> CapturePicture(JNIEnv* env, | 129 base::android::ScopedJavaLocalRef<jobject> CapturePicture(JNIEnv* env, |
127 jobject obj); | 130 jobject obj); |
128 void EnableOnNewPicture(JNIEnv* env, | 131 void EnableOnNewPicture(JNIEnv* env, |
129 jobject obj, | 132 jobject obj, |
130 jboolean enabled, | 133 jboolean enabled, |
131 jboolean invalidation_only); | 134 jboolean invalidation_only); |
132 | 135 |
133 // Geolocation API support | 136 // Geolocation API support |
134 void OnGeolocationShowPrompt(int render_process_id, | 137 void OnGeolocationShowPrompt(const GURL& origin, base::Callback<void(bool)>); |
135 int render_view_id, | 138 void OnGeolocationHidePrompt(const GURL& origin); |
136 int bridge_id, | 139 void InvokeGeolocationCallback(JNIEnv* env, |
137 const GURL& requesting_frame); | 140 jobject obj, |
138 void OnGeolocationHidePrompt(); | 141 jboolean value, |
142 jstring origin); | |
139 | 143 |
140 // Find-in-page API and related methods. | 144 // Find-in-page API and related methods. |
141 jint FindAllSync(JNIEnv* env, jobject obj, jstring search_string); | 145 jint FindAllSync(JNIEnv* env, jobject obj, jstring search_string); |
142 void FindAllAsync(JNIEnv* env, jobject obj, jstring search_string); | 146 void FindAllAsync(JNIEnv* env, jobject obj, jstring search_string); |
143 void FindNext(JNIEnv* env, jobject obj, jboolean forward); | 147 void FindNext(JNIEnv* env, jobject obj, jboolean forward); |
144 void ClearMatches(JNIEnv* env, jobject obj); | 148 void ClearMatches(JNIEnv* env, jobject obj); |
145 void ClearCache(JNIEnv* env, jobject obj, jboolean include_disk_files); | 149 void ClearCache(JNIEnv* env, jobject obj, jboolean include_disk_files); |
146 | 150 |
147 FindHelper* GetFindHelper(); | 151 FindHelper* GetFindHelper(); |
148 | 152 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 bool RenderPicture(SkCanvas* canvas); | 184 bool RenderPicture(SkCanvas* canvas); |
181 | 185 |
182 JavaObjectWeakGlobalRef java_ref_; | 186 JavaObjectWeakGlobalRef java_ref_; |
183 scoped_ptr<content::WebContents> web_contents_; | 187 scoped_ptr<content::WebContents> web_contents_; |
184 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; | 188 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; |
185 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; | 189 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; |
186 scoped_ptr<FindHelper> find_helper_; | 190 scoped_ptr<FindHelper> find_helper_; |
187 scoped_ptr<IconHelper> icon_helper_; | 191 scoped_ptr<IconHelper> icon_helper_; |
188 scoped_ptr<content::WebContents> pending_contents_; | 192 scoped_ptr<content::WebContents> pending_contents_; |
189 | 193 |
194 typedef std::pair<const GURL&, base::Callback<void(bool)> > OriginCallback; | |
joth
2013/02/08 02:15:01
add a comment that the Callback<void(bool)> is the
Kristian Monsen
2013/02/12 18:53:03
Done.
| |
195 std::list<OriginCallback> geolocation_callbacks_; | |
196 | |
190 // Compositor-specific state. | 197 // Compositor-specific state. |
191 scoped_ptr<content::Compositor> compositor_; | 198 scoped_ptr<content::Compositor> compositor_; |
192 scoped_refptr<cc::Layer> scissor_clip_layer_; | 199 scoped_refptr<cc::Layer> scissor_clip_layer_; |
193 scoped_refptr<cc::Layer> transform_layer_; | 200 scoped_refptr<cc::Layer> transform_layer_; |
194 scoped_refptr<cc::Layer> view_clip_layer_; | 201 scoped_refptr<cc::Layer> view_clip_layer_; |
195 gfx::Point hw_rendering_scroll_; | 202 gfx::Point hw_rendering_scroll_; |
196 gfx::Size view_size_; | 203 gfx::Size view_size_; |
197 bool view_visible_; | 204 bool view_visible_; |
198 bool compositor_visible_; | 205 bool compositor_visible_; |
199 bool is_composite_pending_; | 206 bool is_composite_pending_; |
200 float dpi_scale_; | 207 float dpi_scale_; |
201 OnNewPictureMode on_new_picture_mode_; | 208 OnNewPictureMode on_new_picture_mode_; |
202 | 209 |
203 // Used only for detecting Android View System context changes. | 210 // Used only for detecting Android View System context changes. |
204 // Not to be used between draw calls. | 211 // Not to be used between draw calls. |
205 EGLContext last_frame_context_; | 212 EGLContext last_frame_context_; |
206 | 213 |
207 DISALLOW_COPY_AND_ASSIGN(AwContents); | 214 DISALLOW_COPY_AND_ASSIGN(AwContents); |
208 }; | 215 }; |
209 | 216 |
210 bool RegisterAwContents(JNIEnv* env); | 217 bool RegisterAwContents(JNIEnv* env); |
211 | 218 |
212 } // namespace android_webview | 219 } // namespace android_webview |
213 | 220 |
214 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 221 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
OLD | NEW |