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_render_process_gone_delegate.h" |
16 #include "android_webview/browser/browser_view_renderer.h" | 17 #include "android_webview/browser/browser_view_renderer.h" |
17 #include "android_webview/browser/browser_view_renderer_client.h" | 18 #include "android_webview/browser/browser_view_renderer_client.h" |
18 #include "android_webview/browser/find_helper.h" | 19 #include "android_webview/browser/find_helper.h" |
19 #include "android_webview/browser/gl_view_renderer_manager.h" | 20 #include "android_webview/browser/gl_view_renderer_manager.h" |
20 #include "android_webview/browser/icon_helper.h" | 21 #include "android_webview/browser/icon_helper.h" |
21 #include "android_webview/browser/render_thread_manager.h" | 22 #include "android_webview/browser/render_thread_manager.h" |
22 #include "android_webview/browser/render_thread_manager_client.h" | 23 #include "android_webview/browser/render_thread_manager_client.h" |
23 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 24 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
24 #include "android_webview/native/permission/permission_request_handler_client.h" | 25 #include "android_webview/native/permission/permission_request_handler_client.h" |
25 #include "base/android/jni_weak_ref.h" | 26 #include "base/android/jni_weak_ref.h" |
(...skipping 30 matching lines...) Expand all Loading... |
56 // popup content) and discard the 'default' native instance it made on | 57 // popup content) and discard the 'default' native instance it made on |
57 // construction. A native instance is only bound to at most one Java peer over | 58 // construction. A native instance is only bound to at most one Java peer over |
58 // its entire lifetime - see Init() and SetPendingWebContentsForPopup() for the | 59 // its entire lifetime - see Init() and SetPendingWebContentsForPopup() for the |
59 // construction points, and SetJavaPeers() where these paths join. | 60 // construction points, and SetJavaPeers() where these paths join. |
60 class AwContents : public FindHelper::Listener, | 61 class AwContents : public FindHelper::Listener, |
61 public IconHelper::Listener, | 62 public IconHelper::Listener, |
62 public AwRenderViewHostExtClient, | 63 public AwRenderViewHostExtClient, |
63 public BrowserViewRendererClient, | 64 public BrowserViewRendererClient, |
64 public PermissionRequestHandlerClient, | 65 public PermissionRequestHandlerClient, |
65 public AwBrowserPermissionRequestDelegate, | 66 public AwBrowserPermissionRequestDelegate, |
| 67 public AwRenderProcessGoneDelegate, |
66 public content::WebContentsObserver { | 68 public content::WebContentsObserver { |
67 public: | 69 public: |
68 // Returns the AwContents instance associated with |web_contents|, or NULL. | 70 // Returns the AwContents instance associated with |web_contents|, or NULL. |
69 static AwContents* FromWebContents(content::WebContents* web_contents); | 71 static AwContents* FromWebContents(content::WebContents* web_contents); |
70 | 72 |
71 // Returns the AwContents instance associated with with the given | 73 // Returns the AwContents instance associated with with the given |
72 // render_process_id and render_view_id, or NULL. | 74 // render_process_id and render_view_id, or NULL. |
73 static AwContents* FromID(int render_process_id, int render_view_id); | 75 static AwContents* FromID(int render_process_id, int render_view_id); |
74 | 76 |
75 static std::string GetLocale(); | 77 static std::string GetLocale(); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 void ResumeLoadingCreatedPopupWebContents( | 334 void ResumeLoadingCreatedPopupWebContents( |
333 JNIEnv* env, | 335 JNIEnv* env, |
334 const base::android::JavaParamRef<jobject>& obj); | 336 const base::android::JavaParamRef<jobject>& obj); |
335 | 337 |
336 // content::WebContentsObserver overrides | 338 // content::WebContentsObserver overrides |
337 void RenderViewHostChanged(content::RenderViewHost* old_host, | 339 void RenderViewHostChanged(content::RenderViewHost* old_host, |
338 content::RenderViewHost* new_host) override; | 340 content::RenderViewHost* new_host) override; |
339 void DidAttachInterstitialPage() override; | 341 void DidAttachInterstitialPage() override; |
340 void DidDetachInterstitialPage() override; | 342 void DidDetachInterstitialPage() override; |
341 | 343 |
| 344 // AwRenderProcessGoneDelegate overrides |
| 345 void OnRenderProcessGone(int child_process_id) override; |
| 346 bool OnRenderProcessGoneDetail(int child_process_id, bool crashed) override; |
| 347 |
342 private: | 348 private: |
343 void InitAutofillIfNecessary(bool enabled); | 349 void InitAutofillIfNecessary(bool enabled); |
344 | 350 |
345 // Geolocation API support | 351 // Geolocation API support |
346 void ShowGeolocationPrompt(const GURL& origin, base::Callback<void(bool)>); | 352 void ShowGeolocationPrompt(const GURL& origin, base::Callback<void(bool)>); |
347 void HideGeolocationPrompt(const GURL& origin); | 353 void HideGeolocationPrompt(const GURL& origin); |
348 | 354 |
349 void SetDipScaleInternal(float dip_scale); | 355 void SetDipScaleInternal(float dip_scale); |
350 | 356 |
351 void SetAwGLFunctor(AwGLFunctor* functor); | 357 void SetAwGLFunctor(AwGLFunctor* functor); |
(...skipping 21 matching lines...) Expand all Loading... |
373 GLViewRendererManager::Key renderer_manager_key_; | 379 GLViewRendererManager::Key renderer_manager_key_; |
374 | 380 |
375 DISALLOW_COPY_AND_ASSIGN(AwContents); | 381 DISALLOW_COPY_AND_ASSIGN(AwContents); |
376 }; | 382 }; |
377 | 383 |
378 bool RegisterAwContents(JNIEnv* env); | 384 bool RegisterAwContents(JNIEnv* env); |
379 | 385 |
380 } // namespace android_webview | 386 } // namespace android_webview |
381 | 387 |
382 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ | 388 #endif // ANDROID_WEBVIEW_NATIVE_AW_CONTENTS_H_ |
OLD | NEW |