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/ui/views/ssl_client_certificate_selector.h" | 5 #include "chrome/browser/ui/views/ssl_client_certificate_selector.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 if (cert.get()) { | 63 if (cert.get()) { |
64 // Remove the observer before we try unlocking, otherwise we might act on a | 64 // Remove the observer before we try unlocking, otherwise we might act on a |
65 // notification while waiting for the unlock dialog, causing us to delete | 65 // notification while waiting for the unlock dialog, causing us to delete |
66 // ourself before the Unlocked callback gets called. | 66 // ourself before the Unlocked callback gets called. |
67 StopObserving(); | 67 StopObserving(); |
68 #if defined(USE_NSS_CERTS) && !defined(OS_CHROMEOS) | 68 #if defined(USE_NSS_CERTS) && !defined(OS_CHROMEOS) |
69 chrome::UnlockCertSlotIfNecessary( | 69 chrome::UnlockCertSlotIfNecessary( |
70 cert.get(), chrome::kCryptoModulePasswordClientAuth, | 70 cert.get(), chrome::kCryptoModulePasswordClientAuth, |
71 cert_request_info()->host_and_port, GetWidget()->GetNativeView(), | 71 cert_request_info()->host_and_port, GetWidget()->GetNativeView(), |
72 base::Bind(&SSLClientCertificateSelector::Unlocked, | 72 base::Bind(&SSLClientCertificateSelector::Unlocked, |
73 base::Unretained(this), cert)); | 73 base::Unretained(this), base::RetainedRef(cert))); |
74 #else | 74 #else |
75 Unlocked(cert.get()); | 75 Unlocked(cert.get()); |
76 #endif | 76 #endif |
77 return false; // Unlocked() will close the dialog. | 77 return false; // Unlocked() will close the dialog. |
78 } | 78 } |
79 | 79 |
80 return false; | 80 return false; |
81 } | 81 } |
82 | 82 |
83 bool SSLClientCertificateSelector::Close() { | 83 bool SSLClientCertificateSelector::Close() { |
(...skipping 25 matching lines...) Expand all Loading... |
109 if (!SSLClientCertificateSelector::CanShow(contents)) | 109 if (!SSLClientCertificateSelector::CanShow(contents)) |
110 return; | 110 return; |
111 | 111 |
112 SSLClientCertificateSelector* selector = new SSLClientCertificateSelector( | 112 SSLClientCertificateSelector* selector = new SSLClientCertificateSelector( |
113 contents, cert_request_info, std::move(delegate)); | 113 contents, cert_request_info, std::move(delegate)); |
114 selector->Init(); | 114 selector->Init(); |
115 selector->Show(); | 115 selector->Show(); |
116 } | 116 } |
117 | 117 |
118 } // namespace chrome | 118 } // namespace chrome |
OLD | NEW |