Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Side by Side Diff: chromeos/network/onc/onc_certificate_importer.h

Issue 580283005: Revert of Make ONCCertificateImporter async. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nss_util_deadcode
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef CHROMEOS_NETWORK_ONC_ONC_CERTIFICATE_IMPORTER_H_ 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_CERTIFICATE_IMPORTER_H_
6 #define CHROMEOS_NETWORK_ONC_ONC_CERTIFICATE_IMPORTER_H_ 6 #define CHROMEOS_NETWORK_ONC_ONC_CERTIFICATE_IMPORTER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback_forward.h"
10 #include "chromeos/chromeos_export.h" 9 #include "chromeos/chromeos_export.h"
11 #include "components/onc/onc_constants.h" 10 #include "components/onc/onc_constants.h"
12 #include "net/cert/x509_certificate.h" 11 #include "net/cert/x509_certificate.h"
13 12
14 namespace base { 13 namespace base {
15 class ListValue; 14 class ListValue;
16 } 15 }
17 16
18 namespace chromeos { 17 namespace chromeos {
19 namespace onc { 18 namespace onc {
20 19
21 class CHROMEOS_EXPORT CertificateImporter { 20 class CHROMEOS_EXPORT CertificateImporter {
22 public: 21 public:
23 typedef base::Callback<
24 void(bool success, const net::CertificateList& onc_trusted_certificates)>
25 DoneCallback;
26
27 CertificateImporter() {} 22 CertificateImporter() {}
28 virtual ~CertificateImporter() {} 23 virtual ~CertificateImporter() {}
29 24
30 // Import |certificates|, which must be a list of ONC Certificate objects. 25 // Import the |certificates|, which must be a list of ONC Certificate objects.
31 // Certificates are only imported with web trust for user imports. If the 26 // Certificates are only imported with web trust for user imports. If
32 // "Remove" field of a certificate is enabled, then removes the certificate 27 // |onc_trusted_certificates| is not NULL, it will be filled with the list
33 // from the store instead of importing. 28 // of certificates that requested the TrustBit "Web". If the "Remove" field of
34 // When the import is completed, |done_callback| will be called with |success| 29 // a certificate is enabled, then removes the certificate from the store
35 // equal to true if all certificates were imported successfully. 30 // instead of importing. Returns true if all certificates were imported
36 // |onc_trusted_certificates| will contain the list of certificates that 31 // successfully.
37 // were imported and requested the TrustBit "Web". 32 virtual bool ImportCertificates(
38 // Never calls |done_callback| after this importer is destructed. 33 const base::ListValue& certificates,
39 virtual void ImportCertificates(const base::ListValue& certificates, 34 ::onc::ONCSource source,
40 ::onc::ONCSource source, 35 net::CertificateList* onc_trusted_certificates) = 0;
41 const DoneCallback& done_callback) = 0;
42 36
43 private: 37 private:
44 DISALLOW_COPY_AND_ASSIGN(CertificateImporter); 38 DISALLOW_COPY_AND_ASSIGN(CertificateImporter);
45 }; 39 };
46 40
47 } // namespace onc 41 } // namespace onc
48 } // namespace chromeos 42 } // namespace chromeos
49 43
50 #endif // CHROMEOS_NETWORK_ONC_ONC_CERTIFICATE_IMPORTER_H_ 44 #endif // CHROMEOS_NETWORK_ONC_ONC_CERTIFICATE_IMPORTER_H_
OLDNEW
« no previous file with comments | « chromeos/network/onc/mock_certificate_importer.cc ('k') | chromeos/network/onc/onc_certificate_importer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698