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/aw_message_port_message_filter.h" | 14 #include "android_webview/browser/aw_message_port_message_filter.h" |
15 #include "android_webview/browser/browser_view_renderer.h" | 15 #include "android_webview/browser/browser_view_renderer.h" |
16 #include "android_webview/browser/browser_view_renderer_client.h" | 16 #include "android_webview/browser/browser_view_renderer_client.h" |
17 #include "android_webview/browser/find_helper.h" | 17 #include "android_webview/browser/find_helper.h" |
18 #include "android_webview/browser/gl_view_renderer_manager.h" | 18 #include "android_webview/browser/gl_view_renderer_manager.h" |
19 #include "android_webview/browser/icon_helper.h" | 19 #include "android_webview/browser/icon_helper.h" |
20 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 20 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
21 #include "android_webview/browser/shared_renderer_state.h" | |
21 #include "android_webview/native/permission/permission_request_handler_client.h" | 22 #include "android_webview/native/permission/permission_request_handler_client.h" |
22 #include "base/android/jni_weak_ref.h" | 23 #include "base/android/jni_weak_ref.h" |
23 #include "base/android/scoped_java_ref.h" | 24 #include "base/android/scoped_java_ref.h" |
24 #include "base/callback_forward.h" | 25 #include "base/callback_forward.h" |
25 #include "base/macros.h" | 26 #include "base/macros.h" |
26 #include "base/memory/scoped_ptr.h" | 27 #include "base/memory/scoped_ptr.h" |
27 | 28 |
28 class SkBitmap; | 29 class SkBitmap; |
29 class TabContents; | 30 class TabContents; |
30 struct AwDrawGLInfo; | 31 struct AwDrawGLInfo; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 const base::android::JavaParamRef<jobject>& obj, | 157 const base::android::JavaParamRef<jobject>& obj, |
157 const base::android::JavaParamRef<jbyteArray>& state); | 158 const base::android::JavaParamRef<jbyteArray>& state); |
158 void FocusFirstNode(JNIEnv* env, | 159 void FocusFirstNode(JNIEnv* env, |
159 const base::android::JavaParamRef<jobject>& obj); | 160 const base::android::JavaParamRef<jobject>& obj); |
160 void SetBackgroundColor(JNIEnv* env, | 161 void SetBackgroundColor(JNIEnv* env, |
161 const base::android::JavaParamRef<jobject>& obj, | 162 const base::android::JavaParamRef<jobject>& obj, |
162 jint color); | 163 jint color); |
163 void OnComputeScroll(JNIEnv* env, | 164 void OnComputeScroll(JNIEnv* env, |
164 const base::android::JavaParamRef<jobject>& obj, | 165 const base::android::JavaParamRef<jobject>& obj, |
165 jlong animation_time_millis); | 166 jlong animation_time_millis); |
167 | |
168 void CleanUpUncommittedFrame(); | |
boliu
2016/03/23 20:42:33
new methods should be private
Tobias Sargeant
2016/03/24 16:53:05
Done.
| |
169 void CleanUpReturnedResources(); | |
170 | |
171 bool OnDrawHardware(); | |
166 bool OnDraw(JNIEnv* env, | 172 bool OnDraw(JNIEnv* env, |
167 const base::android::JavaParamRef<jobject>& obj, | 173 const base::android::JavaParamRef<jobject>& obj, |
168 const base::android::JavaParamRef<jobject>& canvas, | 174 const base::android::JavaParamRef<jobject>& canvas, |
169 jboolean is_hardware_accelerated, | 175 jboolean is_hardware_accelerated, |
170 jint scroll_x, | 176 jint scroll_x, |
171 jint scroll_y, | 177 jint scroll_y, |
172 jint visible_left, | 178 jint visible_left, |
173 jint visible_top, | 179 jint visible_top, |
174 jint visible_right, | 180 jint visible_right, |
175 jint visible_bottom); | 181 jint visible_bottom); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
333 void InitAutofillIfNecessary(bool enabled); | 339 void InitAutofillIfNecessary(bool enabled); |
334 | 340 |
335 // Geolocation API support | 341 // Geolocation API support |
336 void ShowGeolocationPrompt(const GURL& origin, base::Callback<void(bool)>); | 342 void ShowGeolocationPrompt(const GURL& origin, base::Callback<void(bool)>); |
337 void HideGeolocationPrompt(const GURL& origin); | 343 void HideGeolocationPrompt(const GURL& origin); |
338 | 344 |
339 void SetDipScaleInternal(float dip_scale); | 345 void SetDipScaleInternal(float dip_scale); |
340 | 346 |
341 JavaObjectWeakGlobalRef java_ref_; | 347 JavaObjectWeakGlobalRef java_ref_; |
342 BrowserViewRenderer browser_view_renderer_; // Must outlive |web_contents_|. | 348 BrowserViewRenderer browser_view_renderer_; // Must outlive |web_contents_|. |
349 SharedRendererState shared_renderer_state_; | |
boliu
2016/03/23 20:42:33
Destruction is in reverse declare order, so as cur
| |
343 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; | 350 scoped_ptr<AwWebContentsDelegate> web_contents_delegate_; |
344 scoped_ptr<AwContentsClientBridge> contents_client_bridge_; | 351 scoped_ptr<AwContentsClientBridge> contents_client_bridge_; |
345 scoped_ptr<content::WebContents> web_contents_; | 352 scoped_ptr<content::WebContents> web_contents_; |
346 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; | 353 scoped_ptr<AwRenderViewHostExt> render_view_host_ext_; |
347 scoped_ptr<FindHelper> find_helper_; | 354 scoped_ptr<FindHelper> find_helper_; |
348 scoped_ptr<IconHelper> icon_helper_; | 355 scoped_ptr<IconHelper> icon_helper_; |
349 scoped_ptr<AwContents> pending_contents_; | 356 scoped_ptr<AwContents> pending_contents_; |
350 scoped_ptr<AwPdfExporter> pdf_exporter_; | 357 scoped_ptr<AwPdfExporter> pdf_exporter_; |
351 scoped_ptr<PermissionRequestHandler> permission_request_handler_; | 358 scoped_ptr<PermissionRequestHandler> permission_request_handler_; |
352 scoped_refptr<AwMessagePortMessageFilter> message_port_message_filter_; | 359 scoped_refptr<AwMessagePortMessageFilter> message_port_message_filter_; |
353 | 360 |
354 // GURL is supplied by the content layer as requesting frame. | 361 // GURL is supplied by the content layer as requesting frame. |
355 // Callback is supplied by the content layer, and is invoked with the result | 362 // Callback is supplied by the content layer, and is invoked with the result |
356 // from the permission prompt. | 363 // from the permission prompt. |
357 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; | 364 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; |
358 // The first element in the list is always the currently pending request. | 365 // The first element in the list is always the currently pending request. |
359 std::list<OriginCallback> pending_geolocation_prompts_; | 366 std::list<OriginCallback> pending_geolocation_prompts_; |
360 | 367 |
361 GLViewRendererManager::Key renderer_manager_key_; | 368 GLViewRendererManager::Key renderer_manager_key_; |
362 | 369 |
363 DISALLOW_COPY_AND_ASSIGN(AwContents); | 370 DISALLOW_COPY_AND_ASSIGN(AwContents); |
364 }; | 371 }; |
365 | 372 |
366 bool RegisterAwContents(JNIEnv* env); | 373 bool RegisterAwContents(JNIEnv* env); |
367 | 374 |
368 } // namespace android_webview | 375 } // namespace android_webview |
369 | 376 |
370 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 377 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
OLD | NEW |