| 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_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
| 6 #define ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 6 #define ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "android_webview/browser/aw_web_preferences_populater.h" | 8 #include "android_webview/browser/aw_web_preferences_populater.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 static AwBrowserContext* GetAwBrowserContext(); | 25 static AwBrowserContext* GetAwBrowserContext(); |
| 26 | 26 |
| 27 AwContentBrowserClient(JniDependencyFactory* native_factory); | 27 AwContentBrowserClient(JniDependencyFactory* native_factory); |
| 28 virtual ~AwContentBrowserClient(); | 28 virtual ~AwContentBrowserClient(); |
| 29 | 29 |
| 30 // Overriden methods from ContentBrowserClient. | 30 // Overriden methods from ContentBrowserClient. |
| 31 virtual void AddCertificate(net::CertificateMimeType cert_type, | 31 virtual void AddCertificate(net::CertificateMimeType cert_type, |
| 32 const void* cert_data, | 32 const void* cert_data, |
| 33 size_t cert_size, | 33 size_t cert_size, |
| 34 int render_process_id, | 34 int render_process_id, |
| 35 int render_frame_id) OVERRIDE; | 35 int render_frame_id) override; |
| 36 virtual content::BrowserMainParts* CreateBrowserMainParts( | 36 virtual content::BrowserMainParts* CreateBrowserMainParts( |
| 37 const content::MainFunctionParams& parameters) OVERRIDE; | 37 const content::MainFunctionParams& parameters) override; |
| 38 virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate( | 38 virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate( |
| 39 content::WebContents* web_contents) OVERRIDE; | 39 content::WebContents* web_contents) override; |
| 40 virtual void RenderProcessWillLaunch( | 40 virtual void RenderProcessWillLaunch( |
| 41 content::RenderProcessHost* host) OVERRIDE; | 41 content::RenderProcessHost* host) override; |
| 42 virtual net::URLRequestContextGetter* CreateRequestContext( | 42 virtual net::URLRequestContextGetter* CreateRequestContext( |
| 43 content::BrowserContext* browser_context, | 43 content::BrowserContext* browser_context, |
| 44 content::ProtocolHandlerMap* protocol_handlers, | 44 content::ProtocolHandlerMap* protocol_handlers, |
| 45 content::URLRequestInterceptorScopedVector request_interceptors) OVERRIDE; | 45 content::URLRequestInterceptorScopedVector request_interceptors) override; |
| 46 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( | 46 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 47 content::BrowserContext* browser_context, | 47 content::BrowserContext* browser_context, |
| 48 const base::FilePath& partition_path, | 48 const base::FilePath& partition_path, |
| 49 bool in_memory, | 49 bool in_memory, |
| 50 content::ProtocolHandlerMap* protocol_handlers, | 50 content::ProtocolHandlerMap* protocol_handlers, |
| 51 content::URLRequestInterceptorScopedVector request_interceptors) OVERRIDE; | 51 content::URLRequestInterceptorScopedVector request_interceptors) override; |
| 52 virtual std::string GetCanonicalEncodingNameByAliasName( | 52 virtual std::string GetCanonicalEncodingNameByAliasName( |
| 53 const std::string& alias_name) OVERRIDE; | 53 const std::string& alias_name) override; |
| 54 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, | 54 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, |
| 55 int child_process_id) OVERRIDE; | 55 int child_process_id) override; |
| 56 virtual std::string GetApplicationLocale() OVERRIDE; | 56 virtual std::string GetApplicationLocale() override; |
| 57 virtual std::string GetAcceptLangs(content::BrowserContext* context) OVERRIDE; | 57 virtual std::string GetAcceptLangs(content::BrowserContext* context) override; |
| 58 virtual const gfx::ImageSkia* GetDefaultFavicon() OVERRIDE; | 58 virtual const gfx::ImageSkia* GetDefaultFavicon() override; |
| 59 virtual bool AllowAppCache(const GURL& manifest_url, | 59 virtual bool AllowAppCache(const GURL& manifest_url, |
| 60 const GURL& first_party, | 60 const GURL& first_party, |
| 61 content::ResourceContext* context) OVERRIDE; | 61 content::ResourceContext* context) override; |
| 62 virtual bool AllowGetCookie(const GURL& url, | 62 virtual bool AllowGetCookie(const GURL& url, |
| 63 const GURL& first_party, | 63 const GURL& first_party, |
| 64 const net::CookieList& cookie_list, | 64 const net::CookieList& cookie_list, |
| 65 content::ResourceContext* context, | 65 content::ResourceContext* context, |
| 66 int render_process_id, | 66 int render_process_id, |
| 67 int render_frame_id) OVERRIDE; | 67 int render_frame_id) override; |
| 68 virtual bool AllowSetCookie(const GURL& url, | 68 virtual bool AllowSetCookie(const GURL& url, |
| 69 const GURL& first_party, | 69 const GURL& first_party, |
| 70 const std::string& cookie_line, | 70 const std::string& cookie_line, |
| 71 content::ResourceContext* context, | 71 content::ResourceContext* context, |
| 72 int render_process_id, | 72 int render_process_id, |
| 73 int render_frame_id, | 73 int render_frame_id, |
| 74 net::CookieOptions* options) OVERRIDE; | 74 net::CookieOptions* options) override; |
| 75 virtual bool AllowWorkerDatabase( | 75 virtual bool AllowWorkerDatabase( |
| 76 const GURL& url, | 76 const GURL& url, |
| 77 const base::string16& name, | 77 const base::string16& name, |
| 78 const base::string16& display_name, | 78 const base::string16& display_name, |
| 79 unsigned long estimated_size, | 79 unsigned long estimated_size, |
| 80 content::ResourceContext* context, | 80 content::ResourceContext* context, |
| 81 const std::vector<std::pair<int, int> >& render_frames) OVERRIDE; | 81 const std::vector<std::pair<int, int> >& render_frames) override; |
| 82 virtual void AllowWorkerFileSystem( | 82 virtual void AllowWorkerFileSystem( |
| 83 const GURL& url, | 83 const GURL& url, |
| 84 content::ResourceContext* context, | 84 content::ResourceContext* context, |
| 85 const std::vector<std::pair<int, int> >& render_frames, | 85 const std::vector<std::pair<int, int> >& render_frames, |
| 86 base::Callback<void(bool)> callback) OVERRIDE; | 86 base::Callback<void(bool)> callback) override; |
| 87 virtual bool AllowWorkerIndexedDB( | 87 virtual bool AllowWorkerIndexedDB( |
| 88 const GURL& url, | 88 const GURL& url, |
| 89 const base::string16& name, | 89 const base::string16& name, |
| 90 content::ResourceContext* context, | 90 content::ResourceContext* context, |
| 91 const std::vector<std::pair<int, int> >& render_frames) OVERRIDE; | 91 const std::vector<std::pair<int, int> >& render_frames) override; |
| 92 virtual content::QuotaPermissionContext* | 92 virtual content::QuotaPermissionContext* |
| 93 CreateQuotaPermissionContext() OVERRIDE; | 93 CreateQuotaPermissionContext() override; |
| 94 virtual void AllowCertificateError( | 94 virtual void AllowCertificateError( |
| 95 int render_process_id, | 95 int render_process_id, |
| 96 int render_frame_id, | 96 int render_frame_id, |
| 97 int cert_error, | 97 int cert_error, |
| 98 const net::SSLInfo& ssl_info, | 98 const net::SSLInfo& ssl_info, |
| 99 const GURL& request_url, | 99 const GURL& request_url, |
| 100 content::ResourceType resource_type, | 100 content::ResourceType resource_type, |
| 101 bool overridable, | 101 bool overridable, |
| 102 bool strict_enforcement, | 102 bool strict_enforcement, |
| 103 bool expired_previous_decision, | 103 bool expired_previous_decision, |
| 104 const base::Callback<void(bool)>& callback, | 104 const base::Callback<void(bool)>& callback, |
| 105 content::CertificateRequestResultType* result) OVERRIDE; | 105 content::CertificateRequestResultType* result) override; |
| 106 virtual void SelectClientCertificate( | 106 virtual void SelectClientCertificate( |
| 107 int render_process_id, | 107 int render_process_id, |
| 108 int render_frame_id, | 108 int render_frame_id, |
| 109 const net::HttpNetworkSession* network_session, | 109 const net::HttpNetworkSession* network_session, |
| 110 net::SSLCertRequestInfo* cert_request_info, | 110 net::SSLCertRequestInfo* cert_request_info, |
| 111 const base::Callback<void(net::X509Certificate*)>& callback) OVERRIDE; | 111 const base::Callback<void(net::X509Certificate*)>& callback) override; |
| 112 virtual blink::WebNotificationPermission | 112 virtual blink::WebNotificationPermission |
| 113 CheckDesktopNotificationPermission( | 113 CheckDesktopNotificationPermission( |
| 114 const GURL& source_url, | 114 const GURL& source_url, |
| 115 content::ResourceContext* context, | 115 content::ResourceContext* context, |
| 116 int render_process_id) OVERRIDE; | 116 int render_process_id) override; |
| 117 virtual void ShowDesktopNotification( | 117 virtual void ShowDesktopNotification( |
| 118 const content::ShowDesktopNotificationHostMsgParams& params, | 118 const content::ShowDesktopNotificationHostMsgParams& params, |
| 119 content::RenderFrameHost* render_frame_host, | 119 content::RenderFrameHost* render_frame_host, |
| 120 scoped_ptr<content::DesktopNotificationDelegate> delegate, | 120 scoped_ptr<content::DesktopNotificationDelegate> delegate, |
| 121 base::Closure* cancel_callback) OVERRIDE; | 121 base::Closure* cancel_callback) override; |
| 122 virtual void RequestGeolocationPermission( | 122 virtual void RequestGeolocationPermission( |
| 123 content::WebContents* web_contents, | 123 content::WebContents* web_contents, |
| 124 int bridge_id, | 124 int bridge_id, |
| 125 const GURL& requesting_frame, | 125 const GURL& requesting_frame, |
| 126 bool user_gesture, | 126 bool user_gesture, |
| 127 const base::Callback<void(bool)>& result_callback) OVERRIDE; | 127 const base::Callback<void(bool)>& result_callback) override; |
| 128 virtual void CancelGeolocationPermissionRequest( | 128 virtual void CancelGeolocationPermissionRequest( |
| 129 content::WebContents* web_contents, | 129 content::WebContents* web_contents, |
| 130 int bridge_id, | 130 int bridge_id, |
| 131 const GURL& requesting_frame) OVERRIDE; | 131 const GURL& requesting_frame) override; |
| 132 virtual void RequestMidiSysExPermission( | 132 virtual void RequestMidiSysExPermission( |
| 133 content::WebContents* web_contents, | 133 content::WebContents* web_contents, |
| 134 int bridge_id, | 134 int bridge_id, |
| 135 const GURL& requesting_frame, | 135 const GURL& requesting_frame, |
| 136 bool user_gesture, | 136 bool user_gesture, |
| 137 base::Callback<void(bool)> result_callback, | 137 base::Callback<void(bool)> result_callback, |
| 138 base::Closure* cancel_callback) OVERRIDE; | 138 base::Closure* cancel_callback) override; |
| 139 virtual void RequestProtectedMediaIdentifierPermission( | 139 virtual void RequestProtectedMediaIdentifierPermission( |
| 140 content::WebContents* web_contents, | 140 content::WebContents* web_contents, |
| 141 const GURL& origin, | 141 const GURL& origin, |
| 142 base::Callback<void(bool)> result_callback, | 142 base::Callback<void(bool)> result_callback, |
| 143 base::Closure* cancel_callback) OVERRIDE; | 143 base::Closure* cancel_callback) override; |
| 144 virtual bool CanCreateWindow(const GURL& opener_url, | 144 virtual bool CanCreateWindow(const GURL& opener_url, |
| 145 const GURL& opener_top_level_frame_url, | 145 const GURL& opener_top_level_frame_url, |
| 146 const GURL& source_origin, | 146 const GURL& source_origin, |
| 147 WindowContainerType container_type, | 147 WindowContainerType container_type, |
| 148 const GURL& target_url, | 148 const GURL& target_url, |
| 149 const content::Referrer& referrer, | 149 const content::Referrer& referrer, |
| 150 WindowOpenDisposition disposition, | 150 WindowOpenDisposition disposition, |
| 151 const blink::WebWindowFeatures& features, | 151 const blink::WebWindowFeatures& features, |
| 152 bool user_gesture, | 152 bool user_gesture, |
| 153 bool opener_suppressed, | 153 bool opener_suppressed, |
| 154 content::ResourceContext* context, | 154 content::ResourceContext* context, |
| 155 int render_process_id, | 155 int render_process_id, |
| 156 int opener_id, | 156 int opener_id, |
| 157 bool* no_javascript_access) OVERRIDE; | 157 bool* no_javascript_access) override; |
| 158 virtual void ResourceDispatcherHostCreated() OVERRIDE; | 158 virtual void ResourceDispatcherHostCreated() override; |
| 159 virtual net::NetLog* GetNetLog() OVERRIDE; | 159 virtual net::NetLog* GetNetLog() override; |
| 160 virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE; | 160 virtual content::AccessTokenStore* CreateAccessTokenStore() override; |
| 161 virtual bool IsFastShutdownPossible() OVERRIDE; | 161 virtual bool IsFastShutdownPossible() override; |
| 162 virtual void ClearCache(content::RenderViewHost* rvh) OVERRIDE; | 162 virtual void ClearCache(content::RenderViewHost* rvh) override; |
| 163 virtual void ClearCookies(content::RenderViewHost* rvh) OVERRIDE; | 163 virtual void ClearCookies(content::RenderViewHost* rvh) override; |
| 164 virtual base::FilePath GetDefaultDownloadDirectory() OVERRIDE; | 164 virtual base::FilePath GetDefaultDownloadDirectory() override; |
| 165 virtual std::string GetDefaultDownloadName() OVERRIDE; | 165 virtual std::string GetDefaultDownloadName() override; |
| 166 virtual void DidCreatePpapiPlugin( | 166 virtual void DidCreatePpapiPlugin( |
| 167 content::BrowserPpapiHost* browser_host) OVERRIDE; | 167 content::BrowserPpapiHost* browser_host) override; |
| 168 virtual bool AllowPepperSocketAPI( | 168 virtual bool AllowPepperSocketAPI( |
| 169 content::BrowserContext* browser_context, | 169 content::BrowserContext* browser_context, |
| 170 const GURL& url, | 170 const GURL& url, |
| 171 bool private_api, | 171 bool private_api, |
| 172 const content::SocketPermissionRequest* params) OVERRIDE; | 172 const content::SocketPermissionRequest* params) override; |
| 173 virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh, | 173 virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh, |
| 174 const GURL& url, | 174 const GURL& url, |
| 175 content::WebPreferences* web_prefs) OVERRIDE; | 175 content::WebPreferences* web_prefs) override; |
| 176 #if defined(VIDEO_HOLE) | 176 #if defined(VIDEO_HOLE) |
| 177 virtual content::ExternalVideoSurfaceContainer* | 177 virtual content::ExternalVideoSurfaceContainer* |
| 178 OverrideCreateExternalVideoSurfaceContainer( | 178 OverrideCreateExternalVideoSurfaceContainer( |
| 179 content::WebContents* web_contents) OVERRIDE; | 179 content::WebContents* web_contents) override; |
| 180 #endif | 180 #endif |
| 181 virtual content::DevToolsManagerDelegate* | 181 virtual content::DevToolsManagerDelegate* |
| 182 GetDevToolsManagerDelegate() OVERRIDE; | 182 GetDevToolsManagerDelegate() override; |
| 183 | 183 |
| 184 private: | 184 private: |
| 185 // Android WebView currently has a single global (non-off-the-record) browser | 185 // Android WebView currently has a single global (non-off-the-record) browser |
| 186 // context. | 186 // context. |
| 187 scoped_ptr<AwBrowserContext> browser_context_; | 187 scoped_ptr<AwBrowserContext> browser_context_; |
| 188 scoped_ptr<AwWebPreferencesPopulater> preferences_populater_; | 188 scoped_ptr<AwWebPreferencesPopulater> preferences_populater_; |
| 189 | 189 |
| 190 JniDependencyFactory* native_factory_; | 190 JniDependencyFactory* native_factory_; |
| 191 | 191 |
| 192 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); | 192 DISALLOW_COPY_AND_ASSIGN(AwContentBrowserClient); |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 } // namespace android_webview | 195 } // namespace android_webview |
| 196 | 196 |
| 197 #endif // ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ | 197 #endif // ANDROID_WEBVIEW_LIB_AW_CONTENT_BROWSER_CLIENT_H_ |
| OLD | NEW |