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/memory/scoped_ptr.h" | |
| 12 #include "base/memory/weak_ptr.h" | |
| 13 #include "components/browser_context_keyed_service/browser_context_keyed_service .h" | |
| 14 | |
| 15 class Profile; | |
| 16 class PrefService; | |
| 17 | |
| 18 namespace net { | |
| 19 class CertTrustAnchorProvider; | |
| 20 class X509Certificate; | |
| 21 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; | |
| 22 } | |
| 23 | |
| 24 namespace policy { | |
| 25 | |
| 26 class PolicyCertVerifier; | |
| 27 class PolicyService; | |
| 28 class UserNetworkConfigurationUpdater; | |
| 29 | |
| 30 class NetworkPolicyService : public BrowserContextKeyedService { | |
| 31 public: | |
| 32 NetworkPolicyService(Profile* profile, PolicyService* policy_service); | |
|
Mattias Nissler (ping if slow)
2013/09/20 12:35:23
You actually don't need a full profile, please pas
pneubeck (no reviews)
2013/10/15 13:23:11
Done.
| |
| 33 virtual ~NetworkPolicyService(); | |
| 34 | |
| 35 // Sets the CertVerifier on which the current list of Web trusted server and | |
| 36 // CA certificates will be set. Policy updates will trigger further calls to | |
| 37 // |cert_verifier| later. |cert_verifier| must be valid until | |
| 38 // SetPolicyCertVerifier is called again (with another CertVerifier or NULL) | |
| 39 // or until this Connector is destructed. |cert_verifier|'s methods are only | |
| 40 // called on the IO thread. This function must be called on the UI thread. | |
| 41 void SetPolicyCertVerifier(PolicyCertVerifier* cert_verifier); | |
| 42 | |
| 43 void SetUsedPolicyCertificatesOnce(); | |
|
Mattias Nissler (ping if slow)
2013/09/20 12:35:23
Why is this public?
pneubeck (no reviews)
2013/10/15 13:23:11
Done.
| |
| 44 | |
| 45 // Returns a callback that should be called if a policy installed certificate | |
| 46 // was trusted for the associated profile. The closure can be safely used (on | |
| 47 // the UI thread) even after this Connector is destructed. | |
|
Mattias Nissler (ping if slow)
2013/09/20 12:35:23
I'm still feeling a bit uneasy about the weak ptr
pneubeck (no reviews)
2013/09/20 12:39:36
Who should generate and who should listen? (your c
| |
| 48 base::Closure GetPolicyCertTrustedCallback(); | |
| 49 | |
| 50 // Sets |certs| to the list of Web trusted server and CA certificates from the | |
| 51 // last received ONC user policy. | |
| 52 void GetWebTrustedCertificates(net::CertificateList* certs) const; | |
| 53 | |
| 54 // Returns true if the profile with |user_prefs| has used certificates | |
| 55 // installed via policy to establish a secure connection before. This means | |
| 56 // that it may have cached content from an untrusted source. | |
| 57 bool UsedPolicyCertificates(); | |
| 58 | |
| 59 // BrowserContextKeyedService: | |
| 60 virtual void Shutdown() OVERRIDE; | |
| 61 | |
| 62 private: | |
| 63 PrefService* user_prefs_; | |
| 64 scoped_ptr<UserNetworkConfigurationUpdater> network_configuration_updater_; | |
| 65 base::WeakPtrFactory<NetworkPolicyService> weak_ptr_factory_; | |
| 66 | |
| 67 DISALLOW_COPY_AND_ASSIGN(NetworkPolicyService); | |
| 68 }; | |
| 69 | |
| 70 } // namespace policy | |
| 71 | |
| 72 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_H_ | |
| OLD | NEW |