| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/tab_contents_ssl_helper.h" | 5 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 void TabContentsSSLHelper::SelectClientCertificate( | 207 void TabContentsSSLHelper::SelectClientCertificate( |
| 208 scoped_refptr<SSLClientAuthHandler> handler) { | 208 scoped_refptr<SSLClientAuthHandler> handler) { |
| 209 net::SSLCertRequestInfo* cert_request_info = handler->cert_request_info(); | 209 net::SSLCertRequestInfo* cert_request_info = handler->cert_request_info(); |
| 210 GURL requesting_url("https://" + cert_request_info->host_and_port); | 210 GURL requesting_url("https://" + cert_request_info->host_and_port); |
| 211 DCHECK(requesting_url.is_valid()) << "Invalid URL string: https://" | 211 DCHECK(requesting_url.is_valid()) << "Invalid URL string: https://" |
| 212 << cert_request_info->host_and_port; | 212 << cert_request_info->host_and_port; |
| 213 | 213 |
| 214 HostContentSettingsMap* map = | 214 HostContentSettingsMap* map = |
| 215 tab_contents_->profile()->GetHostContentSettingsMap(); | 215 tab_contents_->profile()->GetHostContentSettingsMap(); |
| 216 scoped_ptr<Value> filter(map->GetContentSettingValue( | 216 scoped_ptr<Value> filter(map->GetContentSettingValue( |
| 217 requesting_url, | 217 requesting_url, requesting_url, |
| 218 requesting_url, | |
| 219 CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, | 218 CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, |
| 220 std::string())); | 219 std::string(), |
| 220 NULL, NULL)); |
| 221 | 221 |
| 222 scoped_refptr<net::X509Certificate> selected_cert; | 222 scoped_refptr<net::X509Certificate> selected_cert; |
| 223 if (filter.get()) { | 223 if (filter.get()) { |
| 224 // Try to automatically select a client certificate. | 224 // Try to automatically select a client certificate. |
| 225 if (filter->IsType(Value::TYPE_DICTIONARY)) { | 225 if (filter->IsType(Value::TYPE_DICTIONARY)) { |
| 226 DictionaryValue* filter_dict = | 226 DictionaryValue* filter_dict = |
| 227 static_cast<DictionaryValue*>(filter.get()); | 227 static_cast<DictionaryValue*>(filter.get()); |
| 228 | 228 |
| 229 const std::vector<scoped_refptr<net::X509Certificate> >& | 229 const std::vector<scoped_refptr<net::X509Certificate> >& |
| 230 all_client_certs = cert_request_info->client_certs; | 230 all_client_certs = cert_request_info->client_certs; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 TabContentsSSLHelper::SSLAddCertData* TabContentsSSLHelper::GetAddCertData( | 300 TabContentsSSLHelper::SSLAddCertData* TabContentsSSLHelper::GetAddCertData( |
| 301 SSLAddCertHandler* handler) { | 301 SSLAddCertHandler* handler) { |
| 302 // Find/create the slot. | 302 // Find/create the slot. |
| 303 linked_ptr<SSLAddCertData>& ptr_ref = | 303 linked_ptr<SSLAddCertData>& ptr_ref = |
| 304 request_id_to_add_cert_data_[handler->network_request_id()]; | 304 request_id_to_add_cert_data_[handler->network_request_id()]; |
| 305 // Fill it if necessary. | 305 // Fill it if necessary. |
| 306 if (!ptr_ref.get()) | 306 if (!ptr_ref.get()) |
| 307 ptr_ref.reset(new SSLAddCertData(tab_contents_)); | 307 ptr_ref.reset(new SSLAddCertData(tab_contents_)); |
| 308 return ptr_ref.get(); | 308 return ptr_ref.get(); |
| 309 } | 309 } |
| OLD | NEW |