| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/api/platform_keys/platform_keys_api.h" | 5 #include "chrome/browser/extensions/api/platform_keys/platform_keys_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 for (const std::vector<char>& cert_authority : | 151 for (const std::vector<char>& cert_authority : |
| 152 params->details.request.certificate_authorities) { | 152 params->details.request.certificate_authorities) { |
| 153 request.certificate_authorities.push_back( | 153 request.certificate_authorities.push_back( |
| 154 std::string(cert_authority.begin(), cert_authority.end())); | 154 std::string(cert_authority.begin(), cert_authority.end())); |
| 155 } | 155 } |
| 156 | 156 |
| 157 service->SelectClientCertificates( | 157 service->SelectClientCertificates( |
| 158 request, params->details.interactive, extension_id(), | 158 request, params->details.interactive, extension_id(), |
| 159 base::Bind(&PlatformKeysInternalSelectClientCertificatesFunction:: | 159 base::Bind(&PlatformKeysInternalSelectClientCertificatesFunction:: |
| 160 OnSelectedCertificates, | 160 OnSelectedCertificates, |
| 161 this)); | 161 this), |
| 162 GetAssociatedWebContents()); |
| 162 return RespondLater(); | 163 return RespondLater(); |
| 163 } | 164 } |
| 164 | 165 |
| 165 void PlatformKeysInternalSelectClientCertificatesFunction:: | 166 void PlatformKeysInternalSelectClientCertificatesFunction:: |
| 166 OnSelectedCertificates(scoped_ptr<net::CertificateList> matches, | 167 OnSelectedCertificates(scoped_ptr<net::CertificateList> matches, |
| 167 const std::string& error_message) { | 168 const std::string& error_message) { |
| 168 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 169 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 169 if (!error_message.empty()) { | 170 if (!error_message.empty()) { |
| 170 Respond(Error(error_message)); | 171 Respond(Error(error_message)); |
| 171 return; | 172 return; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 const std::string& error_message) { | 257 const std::string& error_message) { |
| 257 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 258 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 258 if (error_message.empty()) | 259 if (error_message.empty()) |
| 259 Respond(ArgumentList(api_pki::Sign::Results::Create( | 260 Respond(ArgumentList(api_pki::Sign::Results::Create( |
| 260 std::vector<char>(signature.begin(), signature.end())))); | 261 std::vector<char>(signature.begin(), signature.end())))); |
| 261 else | 262 else |
| 262 Respond(Error(error_message)); | 263 Respond(Error(error_message)); |
| 263 } | 264 } |
| 264 | 265 |
| 265 } // namespace extensions | 266 } // namespace extensions |
| OLD | NEW |