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_POLICY_CERT_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_POLICY_CERT_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_POLICY_CERT_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_POLICY_CERT_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 // Returns true if the profile that owns this service has used certificates | 50 // Returns true if the profile that owns this service has used certificates |
51 // installed via policy to establish a secure connection before. This means | 51 // installed via policy to establish a secure connection before. This means |
52 // that it may have cached content from an untrusted source. | 52 // that it may have cached content from an untrusted source. |
53 bool UsedPolicyCertificates() const; | 53 bool UsedPolicyCertificates() const; |
54 | 54 |
55 bool has_policy_certificates() const { return has_trust_anchors_; } | 55 bool has_policy_certificates() const { return has_trust_anchors_; } |
56 | 56 |
57 // UserNetworkConfigurationUpdater::WebTrustedCertsObserver: | 57 // UserNetworkConfigurationUpdater::WebTrustedCertsObserver: |
58 virtual void OnTrustAnchorsChanged(const net::CertificateList& trust_anchors) | 58 virtual void OnTrustAnchorsChanged(const net::CertificateList& trust_anchors) |
59 OVERRIDE; | 59 override; |
60 | 60 |
61 // KeyedService: | 61 // KeyedService: |
62 virtual void Shutdown() OVERRIDE; | 62 virtual void Shutdown() override; |
63 | 63 |
64 static scoped_ptr<PolicyCertService> CreateForTesting( | 64 static scoped_ptr<PolicyCertService> CreateForTesting( |
65 const std::string& user_id, | 65 const std::string& user_id, |
66 PolicyCertVerifier* verifier, | 66 PolicyCertVerifier* verifier, |
67 user_manager::UserManager* user_manager); | 67 user_manager::UserManager* user_manager); |
68 | 68 |
69 private: | 69 private: |
70 PolicyCertService(const std::string& user_id, | 70 PolicyCertService(const std::string& user_id, |
71 PolicyCertVerifier* verifier, | 71 PolicyCertVerifier* verifier, |
72 user_manager::UserManager* user_manager); | 72 user_manager::UserManager* user_manager); |
73 | 73 |
74 PolicyCertVerifier* cert_verifier_; | 74 PolicyCertVerifier* cert_verifier_; |
75 std::string user_id_; | 75 std::string user_id_; |
76 UserNetworkConfigurationUpdater* net_conf_updater_; | 76 UserNetworkConfigurationUpdater* net_conf_updater_; |
77 user_manager::UserManager* user_manager_; | 77 user_manager::UserManager* user_manager_; |
78 bool has_trust_anchors_; | 78 bool has_trust_anchors_; |
79 | 79 |
80 // Weak pointers to handle callbacks from PolicyCertVerifier on the IO thread. | 80 // Weak pointers to handle callbacks from PolicyCertVerifier on the IO thread. |
81 // The factory and the created WeakPtrs must only be used on the UI thread. | 81 // The factory and the created WeakPtrs must only be used on the UI thread. |
82 base::WeakPtrFactory<PolicyCertService> weak_ptr_factory_; | 82 base::WeakPtrFactory<PolicyCertService> weak_ptr_factory_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(PolicyCertService); | 84 DISALLOW_COPY_AND_ASSIGN(PolicyCertService); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace policy | 87 } // namespace policy |
88 | 88 |
89 #endif // CHROME_BROWSER_CHROMEOS_POLICY_POLICY_CERT_SERVICE_H_ | 89 #endif // CHROME_BROWSER_CHROMEOS_POLICY_POLICY_CERT_SERVICE_H_ |
OLD | NEW |