| 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_browser_permission_request_delegate.h" | 9 #include "android_webview/browser/aw_browser_permission_request_delegate.h" |
| 10 #include "android_webview/browser/aw_contents_client_bridge_base.h" | 10 #include "android_webview/browser/aw_contents_client_bridge_base.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "android_webview/common/render_view_messages.h" | 21 #include "android_webview/common/render_view_messages.h" |
| 22 #include "android_webview/common/url_constants.h" | 22 #include "android_webview/common/url_constants.h" |
| 23 #include "base/android/locale_utils.h" | 23 #include "base/android/locale_utils.h" |
| 24 #include "base/base_paths_android.h" | 24 #include "base/base_paths_android.h" |
| 25 #include "base/path_service.h" | 25 #include "base/path_service.h" |
| 26 #include "components/cdm/browser/cdm_message_filter_android.h" | 26 #include "components/cdm/browser/cdm_message_filter_android.h" |
| 27 #include "content/public/browser/access_token_store.h" | 27 #include "content/public/browser/access_token_store.h" |
| 28 #include "content/public/browser/browser_message_filter.h" | 28 #include "content/public/browser/browser_message_filter.h" |
| 29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 30 #include "content/public/browser/child_process_security_policy.h" | 30 #include "content/public/browser/child_process_security_policy.h" |
| 31 #include "content/public/browser/client_certificate_delegate.h" |
| 31 #include "content/public/browser/permission_type.h" | 32 #include "content/public/browser/permission_type.h" |
| 32 #include "content/public/browser/render_process_host.h" | 33 #include "content/public/browser/render_process_host.h" |
| 33 #include "content/public/browser/render_view_host.h" | 34 #include "content/public/browser/render_view_host.h" |
| 34 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
| 35 #include "content/public/common/url_constants.h" | 36 #include "content/public/common/url_constants.h" |
| 36 #include "content/public/common/web_preferences.h" | 37 #include "content/public/common/web_preferences.h" |
| 37 #include "net/android/network_library.h" | 38 #include "net/android/network_library.h" |
| 38 #include "net/ssl/ssl_cert_request_info.h" | 39 #include "net/ssl/ssl_cert_request_info.h" |
| 39 #include "net/ssl/ssl_info.h" | 40 #include "net/ssl/ssl_info.h" |
| 40 #include "ui/base/resource/resource_bundle.h" | 41 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 client->AllowCertificateError(cert_error, | 362 client->AllowCertificateError(cert_error, |
| 362 ssl_info.cert.get(), | 363 ssl_info.cert.get(), |
| 363 request_url, | 364 request_url, |
| 364 callback, | 365 callback, |
| 365 &cancel_request); | 366 &cancel_request); |
| 366 if (cancel_request) | 367 if (cancel_request) |
| 367 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY; | 368 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY; |
| 368 } | 369 } |
| 369 | 370 |
| 370 void AwContentBrowserClient::SelectClientCertificate( | 371 void AwContentBrowserClient::SelectClientCertificate( |
| 371 int render_process_id, | 372 content::WebContents* web_contents, |
| 372 int render_frame_id, | 373 net::SSLCertRequestInfo* cert_request_info, |
| 373 net::SSLCertRequestInfo* cert_request_info, | 374 scoped_ptr<content::ClientCertificateDelegate> delegate) { |
| 374 const base::Callback<void(net::X509Certificate*)>& callback) { | |
| 375 AwContentsClientBridgeBase* client = | 375 AwContentsClientBridgeBase* client = |
| 376 AwContentsClientBridgeBase::FromID(render_process_id, render_frame_id); | 376 AwContentsClientBridgeBase::FromWebContents(web_contents); |
| 377 if (client) { | 377 if (client) |
| 378 client->SelectClientCertificate(cert_request_info, callback); | 378 client->SelectClientCertificate(cert_request_info, delegate.Pass()); |
| 379 } else { | |
| 380 callback.Run(NULL); | |
| 381 } | |
| 382 } | 379 } |
| 383 | 380 |
| 384 void AwContentBrowserClient::RequestPermission( | 381 void AwContentBrowserClient::RequestPermission( |
| 385 content::PermissionType permission, | 382 content::PermissionType permission, |
| 386 content::WebContents* web_contents, | 383 content::WebContents* web_contents, |
| 387 int bridge_id, | 384 int bridge_id, |
| 388 const GURL& requesting_frame, | 385 const GURL& requesting_frame, |
| 389 bool user_gesture, | 386 bool user_gesture, |
| 390 const base::Callback<void(content::PermissionStatus)>& callback) { | 387 const base::Callback<void(content::PermissionStatus)>& callback) { |
| 391 int render_process_id = web_contents->GetRenderProcessHost()->GetID(); | 388 int render_process_id = web_contents->GetRenderProcessHost()->GetID(); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); | 554 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); |
| 558 } | 555 } |
| 559 #endif | 556 #endif |
| 560 | 557 |
| 561 content::DevToolsManagerDelegate* | 558 content::DevToolsManagerDelegate* |
| 562 AwContentBrowserClient::GetDevToolsManagerDelegate() { | 559 AwContentBrowserClient::GetDevToolsManagerDelegate() { |
| 563 return new AwDevToolsManagerDelegate(); | 560 return new AwDevToolsManagerDelegate(); |
| 564 } | 561 } |
| 565 | 562 |
| 566 } // namespace android_webview | 563 } // namespace android_webview |
| OLD | NEW |