Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1165)

Unified Diff: chrome/browser/chromeos/policy/network_policy_service.h

Issue 24153012: Fix cyclic dependency between ProfilePolicyConnector and PrefService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix some includes and nits. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..c3e4c07f75a2da93d89c951c4c67a7edda9b2a64
--- /dev/null
+++ b/chrome/browser/chromeos/policy/network_policy_service.h
@@ -0,0 +1,72 @@
+// 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/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
+
+class Profile;
+class PrefService;
+
+namespace net {
+class CertTrustAnchorProvider;
+class X509Certificate;
+typedef std::vector<scoped_refptr<X509Certificate> > CertificateList;
+}
+
+namespace policy {
+
+class PolicyCertVerifier;
+class PolicyService;
+class UserNetworkConfigurationUpdater;
+
+class NetworkPolicyService : public BrowserContextKeyedService {
+ public:
+ 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.
+ 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);
+
+ 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.
+
+ // 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.
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
+ base::Closure GetPolicyCertTrustedCallback();
+
+ // 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:
+ PrefService* user_prefs_;
+ scoped_ptr<UserNetworkConfigurationUpdater> network_configuration_updater_;
+ base::WeakPtrFactory<NetworkPolicyService> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(NetworkPolicyService);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_POLICY_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698