[Easy Unlock] Fix a DCHECK: Load localized string correctly.
[chromium-blink-merge.git] / chromeos / network / onc / onc_certificate_importer.h
blob5c2678d4f71feb68422c379efdd5819d76248a94
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
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_NETWORK_ONC_ONC_CERTIFICATE_IMPORTER_H_
6 #define CHROMEOS_NETWORK_ONC_ONC_CERTIFICATE_IMPORTER_H_
8 #include "base/basictypes.h"
9 #include "base/callback_forward.h"
10 #include "chromeos/chromeos_export.h"
11 #include "components/onc/onc_constants.h"
12 #include "net/cert/x509_certificate.h"
14 namespace base {
15 class ListValue;
18 namespace chromeos {
19 namespace onc {
21 class CHROMEOS_EXPORT CertificateImporter {
22 public:
23 typedef base::Callback<
24 void(bool success, const net::CertificateList& onc_trusted_certificates)>
25 DoneCallback;
27 CertificateImporter() {}
28 virtual ~CertificateImporter() {}
30 // Import |certificates|, which must be a list of ONC Certificate objects.
31 // Certificates are only imported with web trust for user imports. If the
32 // "Remove" field of a certificate is enabled, then removes the certificate
33 // from the store instead of importing.
34 // When the import is completed, |done_callback| will be called with |success|
35 // equal to true if all certificates were imported successfully.
36 // |onc_trusted_certificates| will contain the list of certificates that
37 // were imported and requested the TrustBit "Web".
38 // Never calls |done_callback| after this importer is destructed.
39 virtual void ImportCertificates(const base::ListValue& certificates,
40 ::onc::ONCSource source,
41 const DoneCallback& done_callback) = 0;
43 private:
44 DISALLOW_COPY_AND_ASSIGN(CertificateImporter);
47 } // namespace onc
48 } // namespace chromeos
50 #endif // CHROMEOS_NETWORK_ONC_ONC_CERTIFICATE_IMPORTER_H_