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 #include "android_webview/browser/aw_content_browser_client.h" | 5 #include "android_webview/browser/aw_content_browser_client.h" |
6 | 6 |
7 #include "android_webview/browser/aw_browser_main_parts.h" | 7 #include "android_webview/browser/aw_browser_main_parts.h" |
8 #include "android_webview/browser/aw_certificate_error_handler_base.h" | |
8 #include "android_webview/browser/aw_cookie_access_policy.h" | 9 #include "android_webview/browser/aw_cookie_access_policy.h" |
9 #include "android_webview/browser/aw_quota_permission_context.h" | 10 #include "android_webview/browser/aw_quota_permission_context.h" |
10 #include "android_webview/browser/net_disk_cache_remover.h" | 11 #include "android_webview/browser/net_disk_cache_remover.h" |
11 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" | 12 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele gate.h" |
12 #include "android_webview/common/url_constants.h" | 13 #include "android_webview/common/url_constants.h" |
13 #include "base/android/locale_utils.h" | 14 #include "base/android/locale_utils.h" |
14 #include "base/base_paths_android.h" | 15 #include "base/base_paths_android.h" |
15 #include "base/path_service.h" | 16 #include "base/path_service.h" |
16 #include "content/public/browser/access_token_store.h" | 17 #include "content/public/browser/access_token_store.h" |
17 #include "content/public/browser/child_process_security_policy.h" | 18 #include "content/public/browser/child_process_security_policy.h" |
18 #include "content/public/browser/render_process_host.h" | 19 #include "content/public/browser/render_process_host.h" |
19 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
20 #include "content/public/common/url_constants.h" | 21 #include "content/public/common/url_constants.h" |
21 #include "grit/ui_resources.h" | 22 #include "grit/ui_resources.h" |
23 #include "net/base/ssl_info.h" | |
22 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
23 | 25 |
24 namespace { | 26 namespace { |
25 | 27 |
26 class DummyAccessTokenStore : public content::AccessTokenStore { | 28 class DummyAccessTokenStore : public content::AccessTokenStore { |
27 public: | 29 public: |
28 DummyAccessTokenStore() { } | 30 DummyAccessTokenStore() { } |
29 | 31 |
30 virtual void LoadAccessTokens( | 32 virtual void LoadAccessTokens( |
31 const LoadAccessTokensCallbackType& request) OVERRIDE { } | 33 const LoadAccessTokensCallbackType& request) OVERRIDE { } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 void AwContentBrowserClient::AllowCertificateError( | 201 void AwContentBrowserClient::AllowCertificateError( |
200 int render_process_id, | 202 int render_process_id, |
201 int render_view_id, | 203 int render_view_id, |
202 int cert_error, | 204 int cert_error, |
203 const net::SSLInfo& ssl_info, | 205 const net::SSLInfo& ssl_info, |
204 const GURL& request_url, | 206 const GURL& request_url, |
205 bool overridable, | 207 bool overridable, |
206 bool strict_enforcement, | 208 bool strict_enforcement, |
207 const base::Callback<void(bool)>& callback, | 209 const base::Callback<void(bool)>& callback, |
208 bool* cancel_request) { | 210 bool* cancel_request) { |
209 // TODO(boliu): Implement this to power WebViewClient.onReceivedSslError. | 211 |
210 NOTIMPLEMENTED(); | 212 AwCertificateErrorHandlerBase* error_handler = |
211 *cancel_request = true; | 213 AwCertificateErrorHandlerBase::FromID(render_process_id, render_view_id); |
214 DCHECK(error_handler); | |
mkosiba (inactive)
2013/02/04 12:51:31
this is pointless, we'll crash in the next line an
sgurun-gerrit only
2013/02/21 23:32:32
himm, if there is a possibility of rvh not existin
| |
215 error_handler->AllowCertificateError(cert_error, ssl_info.cert, request_url, | |
216 callback, cancel_request); | |
212 } | 217 } |
213 | 218 |
214 WebKit::WebNotificationPresenter::Permission | 219 WebKit::WebNotificationPresenter::Permission |
215 AwContentBrowserClient::CheckDesktopNotificationPermission( | 220 AwContentBrowserClient::CheckDesktopNotificationPermission( |
216 const GURL& source_url, | 221 const GURL& source_url, |
217 content::ResourceContext* context, | 222 content::ResourceContext* context, |
218 int render_process_id) { | 223 int render_process_id) { |
219 // Android WebView does not support notifications, so return Denied here. | 224 // Android WebView does not support notifications, so return Denied here. |
220 return WebKit::WebNotificationPresenter::PermissionDenied; | 225 return WebKit::WebNotificationPresenter::PermissionDenied; |
221 } | 226 } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 | 332 |
328 bool AwContentBrowserClient::AllowPepperSocketAPI( | 333 bool AwContentBrowserClient::AllowPepperSocketAPI( |
329 content::BrowserContext* browser_context, | 334 content::BrowserContext* browser_context, |
330 const GURL& url, | 335 const GURL& url, |
331 const content::SocketPermissionRequest& params) { | 336 const content::SocketPermissionRequest& params) { |
332 NOTREACHED() << "Android WebView does not support plugins"; | 337 NOTREACHED() << "Android WebView does not support plugins"; |
333 return false; | 338 return false; |
334 } | 339 } |
335 | 340 |
336 } // namespace android_webview | 341 } // namespace android_webview |
OLD | NEW |