Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "base/callback_list.h" | |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" | |
| 14 | |
| 15 class PrefService; | |
| 16 | |
| 17 namespace net { | |
| 18 class X509Certificate; | |
| 19 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; | |
| 20 } | |
| 21 | |
| 22 namespace policy { | |
| 23 | |
| 24 class PolicyCertVerifier; | |
| 25 class PolicyService; | |
| 26 class UserNetworkConfigurationUpdater; | |
| 27 | |
| 28 class NetworkPolicyService : public BrowserContextKeyedService { | |
|
Joao da Silva
2013/10/16 12:44:58
Document this class
pneubeck (no reviews)
2013/10/22 18:47:41
Done.
| |
| 29 public: | |
| 30 NetworkPolicyService(PrefService* user_prefs, PolicyService* policy_service); | |
| 31 virtual ~NetworkPolicyService(); | |
| 32 | |
| 33 // Sets the CertVerifier on which the current list of Web trusted server and | |
| 34 // CA certificates will be set. Policy updates will trigger further calls to | |
| 35 // |cert_verifier| later. |cert_verifier| must be valid until | |
| 36 // SetPolicyCertVerifier is called again (with another CertVerifier or NULL) | |
| 37 // or until this Connector is destructed. |cert_verifier|'s methods are only | |
| 38 // called on the IO thread. This function must be called on the UI thread. | |
| 39 void SetPolicyCertVerifier(PolicyCertVerifier* cert_verifier); | |
| 40 | |
| 41 // Returns a callback that should be called if a policy installed certificate | |
| 42 // was trusted for the associated profile. The closure can be safely used (on | |
| 43 // the UI thread) even after this Connector is destructed. | |
| 44 base::Closure GetPolicyCertTrustedCallback(); | |
|
Joao da Silva
2013/10/16 12:44:58
Remove this
pneubeck (no reviews)
2013/10/22 18:47:41
Done.
| |
| 45 | |
| 46 // Sets |certs| to the list of Web trusted server and CA certificates from the | |
| 47 // last received ONC user policy. | |
| 48 void GetWebTrustedCertificates(net::CertificateList* certs) const; | |
| 49 | |
| 50 // Returns true if the profile with |user_prefs| has used certificates | |
| 51 // installed via policy to establish a secure connection before. This means | |
| 52 // that it may have cached content from an untrusted source. | |
| 53 bool UsedPolicyCertificates(); | |
| 54 | |
| 55 // BrowserContextKeyedService: | |
| 56 virtual void Shutdown() OVERRIDE; | |
| 57 | |
| 58 private: | |
| 59 void SetUsedPolicyCertificatesOnce(); | |
| 60 | |
| 61 PrefService* user_prefs_; | |
| 62 scoped_ptr<UserNetworkConfigurationUpdater> network_configuration_updater_; | |
| 63 scoped_ptr<base::CallbackList<void()>::Subscription> | |
| 64 cert_verifier_subscription_; | |
| 65 | |
| 66 DISALLOW_COPY_AND_ASSIGN(NetworkPolicyService); | |
| 67 }; | |
| 68 | |
| 69 } // namespace policy | |
| 70 | |
| 71 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_H_ | |
| OLD | NEW |