| 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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 platform_util::ShowItemInFolder(path); | 1013 platform_util::ShowItemInFolder(path); |
| 1014 } | 1014 } |
| 1015 | 1015 |
| 1016 void ChromeContentBrowserClient::AllowCertificateError( | 1016 void ChromeContentBrowserClient::AllowCertificateError( |
| 1017 int render_process_id, | 1017 int render_process_id, |
| 1018 int render_view_id, | 1018 int render_view_id, |
| 1019 int cert_error, | 1019 int cert_error, |
| 1020 const net::SSLInfo& ssl_info, | 1020 const net::SSLInfo& ssl_info, |
| 1021 const GURL& request_url, | 1021 const GURL& request_url, |
| 1022 bool overridable, | 1022 bool overridable, |
| 1023 bool strict_enforcement, |
| 1023 const base::Callback<void(bool)>& callback, | 1024 const base::Callback<void(bool)>& callback, |
| 1024 bool* cancel_request) { | 1025 bool* cancel_request) { |
| 1025 // If the tab is being prerendered, cancel the prerender and the request. | 1026 // If the tab is being prerendered, cancel the prerender and the request. |
| 1026 WebContents* tab = tab_util::GetWebContentsByID( | 1027 WebContents* tab = tab_util::GetWebContentsByID( |
| 1027 render_process_id, render_view_id); | 1028 render_process_id, render_view_id); |
| 1028 if (!tab) { | 1029 if (!tab) { |
| 1029 NOTREACHED(); | 1030 NOTREACHED(); |
| 1030 return; | 1031 return; |
| 1031 } | 1032 } |
| 1032 prerender::PrerenderManager* prerender_manager = | 1033 prerender::PrerenderManager* prerender_manager = |
| 1033 prerender::PrerenderManagerFactory::GetForProfile( | 1034 prerender::PrerenderManagerFactory::GetForProfile( |
| 1034 Profile::FromBrowserContext(tab->GetBrowserContext())); | 1035 Profile::FromBrowserContext(tab->GetBrowserContext())); |
| 1035 if (prerender_manager && prerender_manager->IsWebContentsPrerendering(tab)) { | 1036 if (prerender_manager && prerender_manager->IsWebContentsPrerendering(tab)) { |
| 1036 if (prerender_manager->prerender_tracker()->TryCancel( | 1037 if (prerender_manager->prerender_tracker()->TryCancel( |
| 1037 render_process_id, render_view_id, | 1038 render_process_id, render_view_id, |
| 1038 prerender::FINAL_STATUS_SSL_ERROR)) { | 1039 prerender::FINAL_STATUS_SSL_ERROR)) { |
| 1039 *cancel_request = true; | 1040 *cancel_request = true; |
| 1040 return; | 1041 return; |
| 1041 } | 1042 } |
| 1042 } | 1043 } |
| 1043 | 1044 |
| 1044 // Otherwise, display an SSL blocking page. | 1045 // Otherwise, display an SSL blocking page. |
| 1045 new SSLBlockingPage( | 1046 new SSLBlockingPage(tab, cert_error, ssl_info, request_url, overridable, |
| 1046 tab, cert_error, ssl_info, request_url, overridable, callback); | 1047 strict_enforcement, callback); |
| 1047 } | 1048 } |
| 1048 | 1049 |
| 1049 void ChromeContentBrowserClient::SelectClientCertificate( | 1050 void ChromeContentBrowserClient::SelectClientCertificate( |
| 1050 int render_process_id, | 1051 int render_process_id, |
| 1051 int render_view_id, | 1052 int render_view_id, |
| 1052 const net::HttpNetworkSession* network_session, | 1053 const net::HttpNetworkSession* network_session, |
| 1053 net::SSLCertRequestInfo* cert_request_info, | 1054 net::SSLCertRequestInfo* cert_request_info, |
| 1054 const base::Callback<void(net::X509Certificate*)>& callback) { | 1055 const base::Callback<void(net::X509Certificate*)>& callback) { |
| 1055 WebContents* tab = tab_util::GetWebContentsByID( | 1056 WebContents* tab = tab_util::GetWebContentsByID( |
| 1056 render_process_id, render_view_id); | 1057 render_process_id, render_view_id); |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1629 #if defined(USE_NSS) | 1630 #if defined(USE_NSS) |
| 1630 crypto::CryptoModuleBlockingPasswordDelegate* | 1631 crypto::CryptoModuleBlockingPasswordDelegate* |
| 1631 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1632 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
| 1632 const GURL& url) { | 1633 const GURL& url) { |
| 1633 return browser::NewCryptoModuleBlockingDialogDelegate( | 1634 return browser::NewCryptoModuleBlockingDialogDelegate( |
| 1634 browser::kCryptoModulePasswordKeygen, url.host()); | 1635 browser::kCryptoModulePasswordKeygen, url.host()); |
| 1635 } | 1636 } |
| 1636 #endif | 1637 #endif |
| 1637 | 1638 |
| 1638 } // namespace chrome | 1639 } // namespace chrome |
| OLD | NEW |