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