OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" | 14 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" |
| 15 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
15 | 16 |
16 namespace chromeos { | 17 namespace chromeos { |
17 class User; | 18 class User; |
18 } | 19 } |
19 | 20 |
20 namespace net { | 21 namespace net { |
21 class X509Certificate; | 22 class X509Certificate; |
22 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; | 23 typedef std::vector<scoped_refptr<X509Certificate> > CertificateList; |
23 } | 24 } |
24 | 25 |
25 namespace policy { | 26 namespace policy { |
26 | 27 |
27 class PolicyCertVerifier; | 28 class PolicyCertVerifier; |
28 class PolicyService; | 29 class PolicyService; |
29 | 30 |
30 // Implements additional special handling of ONC user policies. Namely string | 31 // Implements additional special handling of ONC user policies. Namely string |
31 // expansion with the user's name (or email address, etc.) and handling of "Web" | 32 // expansion with the user's name (or email address, etc.) and handling of "Web" |
32 // trust of certificates. Web trusted certificates are pushed to the | 33 // trust of certificates. Web trusted certificates are pushed to the |
33 // PolicyCertVerifier if set. | 34 // PolicyCertVerifier if set. |
34 class UserNetworkConfigurationUpdater : public NetworkConfigurationUpdater { | 35 class UserNetworkConfigurationUpdater : public NetworkConfigurationUpdater, |
| 36 public BrowserContextKeyedService { |
35 public: | 37 public: |
36 virtual ~UserNetworkConfigurationUpdater(); | 38 virtual ~UserNetworkConfigurationUpdater(); |
37 | 39 |
38 // Creates an updater that applies the ONC user policy from |policy_service| | 40 // Creates an updater that applies the ONC user policy from |policy_service| |
39 // for user |user| once the policy service is completely initialized and on | 41 // for user |user| once the policy service is completely initialized and on |
40 // each policy change. Imported certificates, that request it, are only | 42 // each policy change. Imported certificates, that request it, are only |
41 // granted Web trust if |allow_trusted_certs_from_policy| is true. A reference | 43 // granted Web trust if |allow_trusted_certs_from_policy| is true. A reference |
42 // to |user| is stored. It must outlive the returned updater. | 44 // to |user| is stored. It must outlive the returned updater. |
43 static scoped_ptr<UserNetworkConfigurationUpdater> CreateForUserPolicy( | 45 static scoped_ptr<UserNetworkConfigurationUpdater> CreateForUserPolicy( |
44 bool allow_trusted_certs_from_policy, | 46 bool allow_trusted_certs_from_policy, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Contains the certificates of the last import that requested web trust. Must | 94 // Contains the certificates of the last import that requested web trust. Must |
93 // be empty if Web trust from policy is not allowed. | 95 // be empty if Web trust from policy is not allowed. |
94 net::CertificateList web_trust_certs_; | 96 net::CertificateList web_trust_certs_; |
95 | 97 |
96 DISALLOW_COPY_AND_ASSIGN(UserNetworkConfigurationUpdater); | 98 DISALLOW_COPY_AND_ASSIGN(UserNetworkConfigurationUpdater); |
97 }; | 99 }; |
98 | 100 |
99 } // namespace policy | 101 } // namespace policy |
100 | 102 |
101 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_H_ | 103 #endif // CHROME_BROWSER_CHROMEOS_POLICY_USER_NETWORK_CONFIGURATION_UPDATER_H_ |
OLD | NEW |