Chromium Code Reviews| Index: chrome/browser/chromeos/policy/network_policy_service.h |
| diff --git a/chrome/browser/chromeos/policy/network_policy_service.h b/chrome/browser/chromeos/policy/network_policy_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2e650d730320cf7b8e3457ebc7f3f4d124660f74 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/policy/network_policy_service.h |
| @@ -0,0 +1,71 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_H_ |
| +#define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/callback.h" |
| +#include "base/callback_list.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" |
| + |
| +class PrefService; |
| + |
| +namespace net { |
| +class X509Certificate; |
| +typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; |
| +} |
| + |
| +namespace policy { |
| + |
| +class PolicyCertVerifier; |
| +class PolicyService; |
| +class UserNetworkConfigurationUpdater; |
| + |
| +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.
|
| + public: |
| + NetworkPolicyService(PrefService* user_prefs, PolicyService* policy_service); |
| + virtual ~NetworkPolicyService(); |
| + |
| + // Sets the CertVerifier on which the current list of Web trusted server and |
| + // CA certificates will be set. Policy updates will trigger further calls to |
| + // |cert_verifier| later. |cert_verifier| must be valid until |
| + // SetPolicyCertVerifier is called again (with another CertVerifier or NULL) |
| + // or until this Connector is destructed. |cert_verifier|'s methods are only |
| + // called on the IO thread. This function must be called on the UI thread. |
| + void SetPolicyCertVerifier(PolicyCertVerifier* cert_verifier); |
| + |
| + // Returns a callback that should be called if a policy installed certificate |
| + // was trusted for the associated profile. The closure can be safely used (on |
| + // the UI thread) even after this Connector is destructed. |
| + base::Closure GetPolicyCertTrustedCallback(); |
|
Joao da Silva
2013/10/16 12:44:58
Remove this
pneubeck (no reviews)
2013/10/22 18:47:41
Done.
|
| + |
| + // Sets |certs| to the list of Web trusted server and CA certificates from the |
| + // last received ONC user policy. |
| + void GetWebTrustedCertificates(net::CertificateList* certs) const; |
| + |
| + // Returns true if the profile with |user_prefs| has used certificates |
| + // installed via policy to establish a secure connection before. This means |
| + // that it may have cached content from an untrusted source. |
| + bool UsedPolicyCertificates(); |
| + |
| + // BrowserContextKeyedService: |
| + virtual void Shutdown() OVERRIDE; |
| + |
| + private: |
| + void SetUsedPolicyCertificatesOnce(); |
| + |
| + PrefService* user_prefs_; |
| + scoped_ptr<UserNetworkConfigurationUpdater> network_configuration_updater_; |
| + scoped_ptr<base::CallbackList<void()>::Subscription> |
| + cert_verifier_subscription_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NetworkPolicyService); |
| +}; |
| + |
| +} // namespace policy |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_H_ |