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/ssl/ssl_client_auth_observer.h" | 5 #include "chrome/browser/ssl/ssl_client_auth_observer.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
13 #include "content/public/browser/notification_service.h" | 13 #include "content/public/browser/notification_service.h" |
14 #include "net/cert/x509_certificate.h" | 14 #include "net/cert/x509_certificate.h" |
15 #include "net/ssl/ssl_cert_request_info.h" | 15 #include "net/ssl/ssl_cert_request_info.h" |
16 | 16 |
17 using content::BrowserThread; | 17 using content::BrowserThread; |
18 | 18 |
19 typedef std::pair<net::SSLCertRequestInfo*, net::X509Certificate*> CertDetails; | 19 typedef std::pair<net::SSLCertRequestInfo*, net::X509Certificate*> CertDetails; |
20 | 20 |
21 SSLClientAuthObserver::SSLClientAuthObserver( | 21 SSLClientAuthObserver::SSLClientAuthObserver( |
22 const net::HttpNetworkSession* network_session, | 22 const net::HttpNetworkSession* network_session, |
23 const scoped_refptr<net::SSLCertRequestInfo>& cert_request_info, | 23 net::SSLCertRequestInfo* cert_request_info, |
24 const base::Callback<void(net::X509Certificate*)>& callback) | 24 const base::Callback<void(net::X509Certificate*)>& callback) |
25 : network_session_(network_session), | 25 : network_session_(network_session), |
26 cert_request_info_(cert_request_info), | 26 cert_request_info_(cert_request_info), |
27 callback_(callback) { | 27 callback_(callback) { |
28 } | 28 } |
29 | 29 |
30 SSLClientAuthObserver::~SSLClientAuthObserver() { | 30 SSLClientAuthObserver::~SSLClientAuthObserver() { |
31 } | 31 } |
32 | 32 |
33 void SSLClientAuthObserver::CertificateSelected( | 33 void SSLClientAuthObserver::CertificateSelected( |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 76 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
77 notification_registrar_.Add( | 77 notification_registrar_.Add( |
78 this, chrome::NOTIFICATION_SSL_CLIENT_AUTH_CERT_SELECTED, | 78 this, chrome::NOTIFICATION_SSL_CLIENT_AUTH_CERT_SELECTED, |
79 content::Source<net::HttpNetworkSession>(network_session_)); | 79 content::Source<net::HttpNetworkSession>(network_session_)); |
80 } | 80 } |
81 | 81 |
82 void SSLClientAuthObserver::StopObserving() { | 82 void SSLClientAuthObserver::StopObserving() { |
83 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 83 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
84 notification_registrar_.RemoveAll(); | 84 notification_registrar_.RemoveAll(); |
85 } | 85 } |
OLD | NEW |