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 | 9 |
10 #include <list> | 10 #include <list> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
14 | 14 |
15 #include "android_webview/browser/aw_browser_permission_request_delegate.h" | 15 #include "android_webview/browser/aw_browser_permission_request_delegate.h" |
16 #include "android_webview/browser/aw_message_port_message_filter.h" | |
17 #include "android_webview/browser/browser_view_renderer.h" | 16 #include "android_webview/browser/browser_view_renderer.h" |
18 #include "android_webview/browser/browser_view_renderer_client.h" | 17 #include "android_webview/browser/browser_view_renderer_client.h" |
19 #include "android_webview/browser/find_helper.h" | 18 #include "android_webview/browser/find_helper.h" |
20 #include "android_webview/browser/gl_view_renderer_manager.h" | 19 #include "android_webview/browser/gl_view_renderer_manager.h" |
21 #include "android_webview/browser/icon_helper.h" | 20 #include "android_webview/browser/icon_helper.h" |
22 #include "android_webview/browser/render_thread_manager.h" | 21 #include "android_webview/browser/render_thread_manager.h" |
23 #include "android_webview/browser/render_thread_manager_client.h" | 22 #include "android_webview/browser/render_thread_manager_client.h" |
24 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 23 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
25 #include "android_webview/native/permission/permission_request_handler_client.h" | 24 #include "android_webview/native/permission/permission_request_handler_client.h" |
26 #include "base/android/jni_weak_ref.h" | 25 #include "base/android/jni_weak_ref.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // Sets the java client | 306 // Sets the java client |
308 void SetAwAutofillClient(const base::android::JavaRef<jobject>& client); | 307 void SetAwAutofillClient(const base::android::JavaRef<jobject>& client); |
309 | 308 |
310 void SetJsOnlineProperty(JNIEnv* env, | 309 void SetJsOnlineProperty(JNIEnv* env, |
311 const base::android::JavaParamRef<jobject>& obj, | 310 const base::android::JavaParamRef<jobject>& obj, |
312 jboolean network_up); | 311 jboolean network_up); |
313 void TrimMemory(JNIEnv* env, | 312 void TrimMemory(JNIEnv* env, |
314 const base::android::JavaParamRef<jobject>& obj, | 313 const base::android::JavaParamRef<jobject>& obj, |
315 jint level, | 314 jint level, |
316 jboolean visible); | 315 jboolean visible); |
317 | |
318 scoped_refptr<AwMessagePortMessageFilter> GetMessagePortMessageFilter(); | |
319 void PostMessageToFrame( | 316 void PostMessageToFrame( |
320 JNIEnv* env, | 317 JNIEnv* env, |
321 const base::android::JavaParamRef<jobject>& obj, | 318 const base::android::JavaParamRef<jobject>& obj, |
322 const base::android::JavaParamRef<jstring>& frame_id, | 319 const base::android::JavaParamRef<jstring>& frame_id, |
323 const base::android::JavaParamRef<jstring>& message, | 320 const base::android::JavaParamRef<jstring>& message, |
324 const base::android::JavaParamRef<jstring>& target_origin, | 321 const base::android::JavaParamRef<jstring>& target_origin, |
325 const base::android::JavaParamRef<jintArray>& sent_ports); | 322 const base::android::JavaParamRef<jintArray>& sent_ports); |
326 void CreateMessageChannel( | 323 void CreateMessageChannel( |
327 JNIEnv* env, | 324 JNIEnv* env, |
328 const base::android::JavaParamRef<jobject>& obj, | 325 const base::android::JavaParamRef<jobject>& obj, |
(...skipping 27 matching lines...) Expand all Loading... |
356 BrowserViewRenderer browser_view_renderer_; // Must outlive |web_contents_|. | 353 BrowserViewRenderer browser_view_renderer_; // Must outlive |web_contents_|. |
357 std::unique_ptr<content::WebContents> web_contents_; | 354 std::unique_ptr<content::WebContents> web_contents_; |
358 std::unique_ptr<AwWebContentsDelegate> web_contents_delegate_; | 355 std::unique_ptr<AwWebContentsDelegate> web_contents_delegate_; |
359 std::unique_ptr<AwContentsClientBridge> contents_client_bridge_; | 356 std::unique_ptr<AwContentsClientBridge> contents_client_bridge_; |
360 std::unique_ptr<AwRenderViewHostExt> render_view_host_ext_; | 357 std::unique_ptr<AwRenderViewHostExt> render_view_host_ext_; |
361 std::unique_ptr<FindHelper> find_helper_; | 358 std::unique_ptr<FindHelper> find_helper_; |
362 std::unique_ptr<IconHelper> icon_helper_; | 359 std::unique_ptr<IconHelper> icon_helper_; |
363 std::unique_ptr<AwContents> pending_contents_; | 360 std::unique_ptr<AwContents> pending_contents_; |
364 std::unique_ptr<AwPdfExporter> pdf_exporter_; | 361 std::unique_ptr<AwPdfExporter> pdf_exporter_; |
365 std::unique_ptr<PermissionRequestHandler> permission_request_handler_; | 362 std::unique_ptr<PermissionRequestHandler> permission_request_handler_; |
366 scoped_refptr<AwMessagePortMessageFilter> message_port_message_filter_; | |
367 | 363 |
368 // GURL is supplied by the content layer as requesting frame. | 364 // GURL is supplied by the content layer as requesting frame. |
369 // Callback is supplied by the content layer, and is invoked with the result | 365 // Callback is supplied by the content layer, and is invoked with the result |
370 // from the permission prompt. | 366 // from the permission prompt. |
371 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; | 367 typedef std::pair<const GURL, base::Callback<void(bool)> > OriginCallback; |
372 // The first element in the list is always the currently pending request. | 368 // The first element in the list is always the currently pending request. |
373 std::list<OriginCallback> pending_geolocation_prompts_; | 369 std::list<OriginCallback> pending_geolocation_prompts_; |
374 | 370 |
375 GLViewRendererManager::Key renderer_manager_key_; | 371 GLViewRendererManager::Key renderer_manager_key_; |
376 | 372 |
377 DISALLOW_COPY_AND_ASSIGN(AwContents); | 373 DISALLOW_COPY_AND_ASSIGN(AwContents); |
378 }; | 374 }; |
379 | 375 |
380 bool RegisterAwContents(JNIEnv* env); | 376 bool RegisterAwContents(JNIEnv* env); |
381 | 377 |
382 } // namespace android_webview | 378 } // namespace android_webview |
383 | 379 |
384 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 380 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
OLD | NEW |