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/certificate_manager_model.h" | 5 #include "chrome/browser/certificate_manager_model.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h" | 15 #include "chrome/browser/chromeos/certificate_provider/certificate_provider.h" |
16 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv
ice.h" | 16 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv
ice.h" |
17 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv
ice_factory.h" | 17 #include "chrome/browser/chromeos/certificate_provider/certificate_provider_serv
ice_factory.h" |
18 #include "chrome/browser/net/nss_context.h" | 18 #include "chrome/browser/net/nss_context.h" |
19 #include "chrome/browser/ui/crypto_module_password_dialog_nss.h" | 19 #include "chrome/browser/ui/crypto_module_password_dialog_nss.h" |
20 #include "chrome/common/net/x509_certificate_model.h" | 20 #include "chrome/common/net/x509_certificate_model.h" |
21 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
22 #include "content/public/browser/browser_context.h" | 22 #include "content/public/browser/browser_context.h" |
23 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
24 #include "content/public/browser/resource_context.h" | 24 #include "content/public/browser/resource_context.h" |
25 #include "crypto/nss_util.h" | 25 #include "crypto/nss_util.h" |
26 #include "net/base/crypto_module.h" | |
27 #include "net/base/net_errors.h" | 26 #include "net/base/net_errors.h" |
28 #include "net/cert/x509_certificate.h" | 27 #include "net/cert/x509_certificate.h" |
29 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
30 | 29 |
31 using content::BrowserThread; | 30 using content::BrowserThread; |
32 | 31 |
33 // CertificateManagerModel is created on the UI thread. It needs a | 32 // CertificateManagerModel is created on the UI thread. It needs a |
34 // NSSCertDatabase handle (and on ChromeOS it needs to get the TPM status) which | 33 // NSSCertDatabase handle (and on ChromeOS it needs to get the TPM status) which |
35 // needs to be done on the IO thread. | 34 // needs to be done on the IO thread. |
36 // | 35 // |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( | 327 net::NSSCertDatabase* cert_db = GetNSSCertDatabaseForResourceContext( |
329 context, did_get_cert_db_callback); | 328 context, did_get_cert_db_callback); |
330 | 329 |
331 // The callback is run here instead of the actual function call because of | 330 // The callback is run here instead of the actual function call because of |
332 // extension_certificate_provider ownership semantics, ie. ownership can only | 331 // extension_certificate_provider ownership semantics, ie. ownership can only |
333 // be released once. The callback will only be run once (either inside the | 332 // be released once. The callback will only be run once (either inside the |
334 // function above or here). | 333 // function above or here). |
335 if (cert_db) | 334 if (cert_db) |
336 did_get_cert_db_callback.Run(cert_db); | 335 did_get_cert_db_callback.Run(cert_db); |
337 } | 336 } |
OLD | NEW |