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_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
8 #include "android_webview/browser/aw_browser_main_parts.h" | 8 #include "android_webview/browser/aw_browser_main_parts.h" |
| 9 #include "android_webview/browser/aw_contents_client_bridge_base.h" |
9 #include "android_webview/browser/aw_cookie_access_policy.h" | 10 #include "android_webview/browser/aw_cookie_access_policy.h" |
10 #include "android_webview/browser/aw_quota_permission_context.h" | 11 #include "android_webview/browser/aw_quota_permission_context.h" |
11 #include "android_webview/browser/jni_dependency_factory.h" | 12 #include "android_webview/browser/jni_dependency_factory.h" |
12 #include "android_webview/browser/net_disk_cache_remover.h" | 13 #include "android_webview/browser/net_disk_cache_remover.h" |
13 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" | 14 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" |
14 #include "android_webview/common/url_constants.h" | 15 #include "android_webview/common/url_constants.h" |
15 #include "base/android/locale_utils.h" | 16 #include "base/android/locale_utils.h" |
16 #include "base/base_paths_android.h" | 17 #include "base/base_paths_android.h" |
17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
18 #include "content/public/browser/access_token_store.h" | 19 #include "content/public/browser/access_token_store.h" |
19 #include "content/public/browser/child_process_security_policy.h" | 20 #include "content/public/browser/child_process_security_policy.h" |
20 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
21 #include "content/public/browser/render_view_host.h" | 22 #include "content/public/browser/render_view_host.h" |
22 #include "content/public/common/url_constants.h" | 23 #include "content/public/common/url_constants.h" |
23 #include "grit/ui_resources.h" | 24 #include "grit/ui_resources.h" |
24 #include "net/android/network_library.h" | 25 #include "net/android/network_library.h" |
| 26 #include "net/base/ssl_info.h" |
25 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
26 | 28 |
27 namespace { | 29 namespace { |
28 | 30 |
29 class AwAccessTokenStore : public content::AccessTokenStore { | 31 class AwAccessTokenStore : public content::AccessTokenStore { |
30 public: | 32 public: |
31 AwAccessTokenStore() { } | 33 AwAccessTokenStore() { } |
32 | 34 |
33 // content::AccessTokenStore implementation | 35 // content::AccessTokenStore implementation |
34 virtual void LoadAccessTokens( | 36 virtual void LoadAccessTokens( |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 int render_process_id, | 268 int render_process_id, |
267 int render_view_id, | 269 int render_view_id, |
268 int cert_error, | 270 int cert_error, |
269 const net::SSLInfo& ssl_info, | 271 const net::SSLInfo& ssl_info, |
270 const GURL& request_url, | 272 const GURL& request_url, |
271 ResourceType::Type resource_type, | 273 ResourceType::Type resource_type, |
272 bool overridable, | 274 bool overridable, |
273 bool strict_enforcement, | 275 bool strict_enforcement, |
274 const base::Callback<void(bool)>& callback, | 276 const base::Callback<void(bool)>& callback, |
275 bool* cancel_request) { | 277 bool* cancel_request) { |
276 // TODO(boliu): Implement this to power WebViewClient.onReceivedSslError. | 278 |
277 NOTIMPLEMENTED(); | 279 AwContentsClientBridgeBase* client = |
278 *cancel_request = true; | 280 AwContentsClientBridgeBase::FromID(render_process_id, render_view_id); |
| 281 if (client) { |
| 282 client->AllowCertificateError(cert_error, ssl_info.cert, request_url, |
| 283 callback, cancel_request); |
| 284 } else { |
| 285 *cancel_request = true; |
| 286 } |
279 } | 287 } |
280 | 288 |
281 WebKit::WebNotificationPresenter::Permission | 289 WebKit::WebNotificationPresenter::Permission |
282 AwContentBrowserClient::CheckDesktopNotificationPermission( | 290 AwContentBrowserClient::CheckDesktopNotificationPermission( |
283 const GURL& source_url, | 291 const GURL& source_url, |
284 content::ResourceContext* context, | 292 content::ResourceContext* context, |
285 int render_process_id) { | 293 int render_process_id) { |
286 // Android WebView does not support notifications, so return Denied here. | 294 // Android WebView does not support notifications, so return Denied here. |
287 return WebKit::WebNotificationPresenter::PermissionDenied; | 295 return WebKit::WebNotificationPresenter::PermissionDenied; |
288 } | 296 } |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 | 401 |
394 bool AwContentBrowserClient::AllowPepperSocketAPI( | 402 bool AwContentBrowserClient::AllowPepperSocketAPI( |
395 content::BrowserContext* browser_context, | 403 content::BrowserContext* browser_context, |
396 const GURL& url, | 404 const GURL& url, |
397 const content::SocketPermissionRequest& params) { | 405 const content::SocketPermissionRequest& params) { |
398 NOTREACHED() << "Android WebView does not support plugins"; | 406 NOTREACHED() << "Android WebView does not support plugins"; |
399 return false; | 407 return false; |
400 } | 408 } |
401 | 409 |
402 } // namespace android_webview | 410 } // namespace android_webview |
OLD | NEW |