Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chromeos / network / network_cert_migrator.h
blobf4fc4dba13d75c4844c8753456127710f4ec3b23
1 // Copyright 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_NETWORK_CERT_MIGRATOR_H_
6 #define CHROMEOS_NETWORK_NETWORK_CERT_MIGRATOR_H_
8 #include "base/basictypes.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chromeos/cert_loader.h"
11 #include "chromeos/chromeos_export.h"
12 #include "chromeos/network/network_state_handler_observer.h"
14 namespace chromeos {
16 class NetworkStateHandler;
18 // Migrates network configurations with incorrect or missing slot IDs of client
19 // certificates.
20 class CHROMEOS_EXPORT NetworkCertMigrator : public NetworkStateHandlerObserver,
21 public CertLoader::Observer {
22 public:
23 ~NetworkCertMigrator() override;
25 private:
26 friend class NetworkHandler;
27 friend class NetworkCertMigratorTest;
28 class MigrationTask;
30 NetworkCertMigrator();
31 void Init(NetworkStateHandler* network_state_handler);
33 // NetworkStateHandlerObserver overrides
34 void NetworkListChanged() override;
36 // CertLoader::Observer overrides
37 void OnCertificatesLoaded(const net::CertificateList& cert_list,
38 bool initial_load) override;
40 // Unowned associated NetworkStateHandler* (global or test instance).
41 NetworkStateHandler* network_state_handler_;
43 base::WeakPtrFactory<NetworkCertMigrator> weak_ptr_factory_;
45 DISALLOW_COPY_AND_ASSIGN(NetworkCertMigrator);
48 } // namespace chromeos
50 #endif // CHROMEOS_NETWORK_NETWORK_CERT_MIGRATOR_H_