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> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "android_webview/browser/aw_browser_permission_request_delegate.h" | 13 #include "android_webview/browser/aw_browser_permission_request_delegate.h" |
14 #include "android_webview/browser/browser_view_renderer.h" | 14 #include "android_webview/browser/browser_view_renderer.h" |
15 #include "android_webview/browser/browser_view_renderer_client.h" | 15 #include "android_webview/browser/browser_view_renderer_client.h" |
16 #include "android_webview/browser/find_helper.h" | 16 #include "android_webview/browser/find_helper.h" |
17 #include "android_webview/browser/gl_view_renderer_manager.h" | 17 #include "android_webview/browser/gl_view_renderer_manager.h" |
18 #include "android_webview/browser/icon_helper.h" | 18 #include "android_webview/browser/icon_helper.h" |
19 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 19 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
20 #include "android_webview/native/permission/permission_request_handler_client.h" | 20 #include "android_webview/native/permission/permission_request_handler_client.h" |
21 #include "base/android/jni_weak_ref.h" | 21 #include "base/android/jni_weak_ref.h" |
22 #include "base/android/scoped_java_ref.h" | 22 #include "base/android/scoped_java_ref.h" |
23 #include "base/callback_forward.h" | 23 #include "base/callback_forward.h" |
24 #include "base/memory/scoped_ptr.h" | 24 #include "base/memory/scoped_ptr.h" |
| 25 #include "ui/base/android/window_android_observer.h" |
25 | 26 |
26 class SkBitmap; | 27 class SkBitmap; |
27 class TabContents; | 28 class TabContents; |
28 struct AwDrawGLInfo; | 29 struct AwDrawGLInfo; |
29 | 30 |
30 namespace content { | 31 namespace content { |
31 class WebContents; | 32 class WebContents; |
32 } | 33 } |
33 | 34 |
34 namespace android_webview { | 35 namespace android_webview { |
(...skipping 16 matching lines...) Expand all Loading... |
51 // hosts a popup will be rebound to a second native instance (carrying the | 52 // hosts a popup will be rebound to a second native instance (carrying the |
52 // popup content) and discard the 'default' native instance it made on | 53 // popup content) and discard the 'default' native instance it made on |
53 // construction. A native instance is only bound to at most one Java peer over | 54 // construction. A native instance is only bound to at most one Java peer over |
54 // its entire lifetime - see Init() and SetPendingWebContentsForPopup() for the | 55 // its entire lifetime - see Init() and SetPendingWebContentsForPopup() for the |
55 // construction points, and SetJavaPeers() where these paths join. | 56 // construction points, and SetJavaPeers() where these paths join. |
56 class AwContents : public FindHelper::Listener, | 57 class AwContents : public FindHelper::Listener, |
57 public IconHelper::Listener, | 58 public IconHelper::Listener, |
58 public AwRenderViewHostExtClient, | 59 public AwRenderViewHostExtClient, |
59 public BrowserViewRendererClient, | 60 public BrowserViewRendererClient, |
60 public PermissionRequestHandlerClient, | 61 public PermissionRequestHandlerClient, |
61 public AwBrowserPermissionRequestDelegate { | 62 public AwBrowserPermissionRequestDelegate, |
| 63 public WindowAndroidObserver { |
62 public: | 64 public: |
63 // Returns the AwContents instance associated with |web_contents|, or NULL. | 65 // Returns the AwContents instance associated with |web_contents|, or NULL. |
64 static AwContents* FromWebContents(content::WebContents* web_contents); | 66 static AwContents* FromWebContents(content::WebContents* web_contents); |
65 | 67 |
66 // Returns the AwContents instance associated with with the given | 68 // Returns the AwContents instance associated with with the given |
67 // render_process_id and render_view_id, or NULL. | 69 // render_process_id and render_view_id, or NULL. |
68 static AwContents* FromID(int render_process_id, int render_view_id); | 70 static AwContents* FromID(int render_process_id, int render_view_id); |
69 | 71 |
70 AwContents(scoped_ptr<content::WebContents> web_contents); | 72 AwContents(scoped_ptr<content::WebContents> web_contents); |
71 virtual ~AwContents(); | 73 virtual ~AwContents(); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 virtual void OnNewPicture() override; | 198 virtual void OnNewPicture() override; |
197 virtual gfx::Point GetLocationOnScreen() override; | 199 virtual gfx::Point GetLocationOnScreen() override; |
198 virtual void ScrollContainerViewTo(gfx::Vector2d new_value) override; | 200 virtual void ScrollContainerViewTo(gfx::Vector2d new_value) override; |
199 virtual bool IsFlingActive() const override; | 201 virtual bool IsFlingActive() const override; |
200 virtual void UpdateScrollState(gfx::Vector2d max_scroll_offset, | 202 virtual void UpdateScrollState(gfx::Vector2d max_scroll_offset, |
201 gfx::SizeF contents_size_dip, | 203 gfx::SizeF contents_size_dip, |
202 float page_scale_factor, | 204 float page_scale_factor, |
203 float min_page_scale_factor, | 205 float min_page_scale_factor, |
204 float max_page_scale_factor) override; | 206 float max_page_scale_factor) override; |
205 virtual void DidOverscroll(gfx::Vector2d overscroll_delta) override; | 207 virtual void DidOverscroll(gfx::Vector2d overscroll_delta) override; |
| 208 virtual void RequestVSyncUpdate() override; |
206 | 209 |
207 const BrowserViewRenderer* GetBrowserViewRenderer() const; | 210 const BrowserViewRenderer* GetBrowserViewRenderer() const; |
208 | 211 |
| 212 // WindowAndroidObserver implementation. |
| 213 virtual void OnCompositingDidCommit() override {} |
| 214 virtual void OnAttachCompositor() override {} |
| 215 virtual void OnDetachCompositor() override {} |
| 216 virtual void OnVSync(base::TimeTicks frame_time, |
| 217 base::TimeDelta vsync_period) override; |
| 218 |
209 void ClearCache(JNIEnv* env, jobject obj, jboolean include_disk_files); | 219 void ClearCache(JNIEnv* env, jobject obj, jboolean include_disk_files); |
210 void SetPendingWebContentsForPopup(scoped_ptr<content::WebContents> pending); | 220 void SetPendingWebContentsForPopup(scoped_ptr<content::WebContents> pending); |
211 jlong ReleasePopupAwContents(JNIEnv* env, jobject obj); | 221 jlong ReleasePopupAwContents(JNIEnv* env, jobject obj); |
212 | 222 |
213 void ScrollTo(JNIEnv* env, jobject obj, jint x, jint y); | 223 void ScrollTo(JNIEnv* env, jobject obj, jint x, jint y); |
214 void SetDipScale(JNIEnv* env, jobject obj, jfloat dip_scale); | 224 void SetDipScale(JNIEnv* env, jobject obj, jfloat dip_scale); |
215 void SetSaveFormData(bool enabled); | 225 void SetSaveFormData(bool enabled); |
216 | 226 |
217 // Sets the java client | 227 // Sets the java client |
218 void SetAwAutofillClient(jobject client); | 228 void SetAwAutofillClient(jobject client); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 GLViewRendererManager::Key renderer_manager_key_; | 265 GLViewRendererManager::Key renderer_manager_key_; |
256 | 266 |
257 DISALLOW_COPY_AND_ASSIGN(AwContents); | 267 DISALLOW_COPY_AND_ASSIGN(AwContents); |
258 }; | 268 }; |
259 | 269 |
260 bool RegisterAwContents(JNIEnv* env); | 270 bool RegisterAwContents(JNIEnv* env); |
261 | 271 |
262 } // namespace android_webview | 272 } // namespace android_webview |
263 | 273 |
264 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 274 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
OLD | NEW |