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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1718 if (expired_previous_decision) | 1718 if (expired_previous_decision) |
1719 options_mask = SSLBlockingPage::EXPIRED_BUT_PREVIOUSLY_ALLOWED; | 1719 options_mask = SSLBlockingPage::EXPIRED_BUT_PREVIOUSLY_ALLOWED; |
1720 SSLBlockingPage* ssl_blocking_page = new SSLBlockingPage( | 1720 SSLBlockingPage* ssl_blocking_page = new SSLBlockingPage( |
1721 tab, cert_error, ssl_info, request_url, options_mask, callback); | 1721 tab, cert_error, ssl_info, request_url, options_mask, callback); |
1722 ssl_blocking_page->Show(); | 1722 ssl_blocking_page->Show(); |
1723 } | 1723 } |
1724 | 1724 |
1725 void ChromeContentBrowserClient::SelectClientCertificate( | 1725 void ChromeContentBrowserClient::SelectClientCertificate( |
1726 int render_process_id, | 1726 int render_process_id, |
1727 int render_frame_id, | 1727 int render_frame_id, |
1728 const net::HttpNetworkSession* network_session, | |
1729 net::SSLCertRequestInfo* cert_request_info, | 1728 net::SSLCertRequestInfo* cert_request_info, |
1730 const base::Callback<void(net::X509Certificate*)>& callback) { | 1729 const base::Callback<void(net::X509Certificate*)>& callback) { |
1731 content::RenderFrameHost* rfh = content::RenderFrameHost::FromID( | 1730 content::RenderFrameHost* rfh = content::RenderFrameHost::FromID( |
1732 render_process_id, render_frame_id); | 1731 render_process_id, render_frame_id); |
1733 WebContents* tab = WebContents::FromRenderFrameHost(rfh); | 1732 WebContents* tab = WebContents::FromRenderFrameHost(rfh); |
1734 if (!tab) { | 1733 if (!tab) { |
1735 NOTREACHED(); | 1734 NOTREACHED(); |
| 1735 callback.Run(NULL); |
1736 return; | 1736 return; |
1737 } | 1737 } |
1738 | 1738 |
1739 prerender::PrerenderContents* prerender_contents = | 1739 prerender::PrerenderContents* prerender_contents = |
1740 prerender::PrerenderContents::FromWebContents(tab); | 1740 prerender::PrerenderContents::FromWebContents(tab); |
1741 if (prerender_contents) { | 1741 if (prerender_contents) { |
1742 prerender_contents->Destroy( | 1742 prerender_contents->Destroy( |
1743 prerender::FINAL_STATUS_SSL_CLIENT_CERTIFICATE_REQUESTED); | 1743 prerender::FINAL_STATUS_SSL_CLIENT_CERTIFICATE_REQUESTED); |
| 1744 callback.Run(NULL); |
1744 return; | 1745 return; |
1745 } | 1746 } |
1746 | 1747 |
1747 GURL requesting_url("https://" + cert_request_info->host_and_port.ToString()); | 1748 GURL requesting_url("https://" + cert_request_info->host_and_port.ToString()); |
1748 DCHECK(requesting_url.is_valid()) | 1749 DCHECK(requesting_url.is_valid()) |
1749 << "Invalid URL string: https://" | 1750 << "Invalid URL string: https://" |
1750 << cert_request_info->host_and_port.ToString(); | 1751 << cert_request_info->host_and_port.ToString(); |
1751 | 1752 |
1752 Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext()); | 1753 Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext()); |
1753 scoped_ptr<base::Value> filter = | 1754 scoped_ptr<base::Value> filter = |
(...skipping 17 matching lines...) Expand all Loading... |
1771 // Use the first certificate that is matched by the filter. | 1772 // Use the first certificate that is matched by the filter. |
1772 callback.Run(all_client_certs[i].get()); | 1773 callback.Run(all_client_certs[i].get()); |
1773 return; | 1774 return; |
1774 } | 1775 } |
1775 } | 1776 } |
1776 } else { | 1777 } else { |
1777 NOTREACHED(); | 1778 NOTREACHED(); |
1778 } | 1779 } |
1779 } | 1780 } |
1780 | 1781 |
1781 chrome::ShowSSLClientCertificateSelector(tab, network_session, | 1782 chrome::ShowSSLClientCertificateSelector(tab, cert_request_info, callback); |
1782 cert_request_info, callback); | |
1783 } | 1783 } |
1784 | 1784 |
1785 void ChromeContentBrowserClient::AddCertificate( | 1785 void ChromeContentBrowserClient::AddCertificate( |
1786 net::CertificateMimeType cert_type, | 1786 net::CertificateMimeType cert_type, |
1787 const void* cert_data, | 1787 const void* cert_data, |
1788 size_t cert_size, | 1788 size_t cert_size, |
1789 int render_process_id, | 1789 int render_process_id, |
1790 int render_frame_id) { | 1790 int render_frame_id) { |
1791 chrome::SSLAddCertificate(cert_type, cert_data, cert_size, | 1791 chrome::SSLAddCertificate(cert_type, cert_data, cert_size, |
1792 render_process_id, render_frame_id); | 1792 render_process_id, render_frame_id); |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2593 switches::kDisableWebRtcEncryption, | 2593 switches::kDisableWebRtcEncryption, |
2594 }; | 2594 }; |
2595 to_command_line->CopySwitchesFrom(from_command_line, | 2595 to_command_line->CopySwitchesFrom(from_command_line, |
2596 kWebRtcDevSwitchNames, | 2596 kWebRtcDevSwitchNames, |
2597 arraysize(kWebRtcDevSwitchNames)); | 2597 arraysize(kWebRtcDevSwitchNames)); |
2598 } | 2598 } |
2599 } | 2599 } |
2600 #endif // defined(ENABLE_WEBRTC) | 2600 #endif // defined(ENABLE_WEBRTC) |
2601 | 2601 |
2602 } // namespace chrome | 2602 } // namespace chrome |
OLD | NEW |