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

Side by Side Diff: chrome/browser/chromeos/policy/network_configuration_updater_impl.h

Issue 14192017: Extract certificate policy application from NetworkLibrary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_
6 #define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ 6 #define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_
7 7
8 #include <string>
9
10 #include "chrome/browser/chromeos/policy/network_configuration_updater.h" 8 #include "chrome/browser/chromeos/policy/network_configuration_updater.h"
11 #include "chrome/browser/policy/policy_service.h" 9 #include "chrome/browser/policy/policy_service.h"
12 #include "chromeos/network/onc/onc_constants.h" 10 #include "chromeos/network/onc/onc_constants.h"
13 11
14 namespace base { 12 namespace base {
15 class Value; 13 class Value;
16 } 14 }
17 15
16 namespace chromeos {
17 class CertificateHandler;
18 class ManagedNetworkConfigurationHandler;
19 }
20
18 namespace policy { 21 namespace policy {
19 22
20 class PolicyMap; 23 class PolicyMap;
21 24
22 // This implementation pushes policies to the 25 // This implementation pushes policies to the
23 // ManagedNetworkConfigurationHandler. User policies are only pushed after 26 // ManagedNetworkConfigurationHandler. User policies are only pushed after
24 // OnUserPolicyInitialized() was called. 27 // OnUserPolicyInitialized() was called.
25 // TODO(pneubeck): Certificates are not implemented yet, they are silently 28 // TODO(pneubeck): Certificates are not implemented yet, they are silently
26 // ignored. 29 // ignored.
27 class NetworkConfigurationUpdaterImpl : public NetworkConfigurationUpdater { 30 class NetworkConfigurationUpdaterImpl : public NetworkConfigurationUpdater {
28 public: 31 public:
29 explicit NetworkConfigurationUpdaterImpl(PolicyService* policy_service); 32 NetworkConfigurationUpdaterImpl(
33 PolicyService* policy_service,
34 chromeos::ManagedNetworkConfigurationHandler* network_config_handler,
35 scoped_ptr<chromeos::CertificateHandler> certificate_handler);
30 virtual ~NetworkConfigurationUpdaterImpl(); 36 virtual ~NetworkConfigurationUpdaterImpl();
31 37
32 // NetworkConfigurationUpdater overrides. 38 // NetworkConfigurationUpdater overrides.
33
34 virtual void OnUserPolicyInitialized() OVERRIDE; 39 virtual void OnUserPolicyInitialized() OVERRIDE;
35 virtual void set_allow_trusted_certificates_from_policy(bool allow) OVERRIDE {
36 }
37 virtual net::CertTrustAnchorProvider* GetCertTrustAnchorProvider() OVERRIDE;
38 40
39 private: 41 private:
40 // Callback that's called by |policy_service_| if the respective ONC policy 42 // Callback that's called by |policy_service_| if the respective ONC policy
41 // changed. 43 // changed.
42 void OnPolicyChanged(chromeos::onc::ONCSource onc_source, 44 void OnPolicyChanged(chromeos::onc::ONCSource onc_source,
43 const base::Value* previous, 45 const base::Value* previous,
44 const base::Value* current); 46 const base::Value* current);
45 47
46 void ApplyNetworkConfiguration(chromeos::onc::ONCSource onc_source); 48 void ApplyNetworkConfiguration(chromeos::onc::ONCSource onc_source);
47 49
48 // Whether the user policy is already available. 50 // Whether the user policy is already available.
49 bool user_policy_initialized_; 51 bool user_policy_initialized_;
50 52
51 // Wraps the policy service we read network configuration from. 53 // Wraps the policy service we read network configuration from.
52 PolicyChangeRegistrar policy_change_registrar_; 54 PolicyChangeRegistrar policy_change_registrar_;
53 55
54 // The policy service storing the ONC policies. 56 // The policy service storing the ONC policies.
55 PolicyService* policy_service_; 57 PolicyService* policy_service_;
56 58
59 // Pointer to the global singleton or mock provided to the constructor.
60 chromeos::ManagedNetworkConfigurationHandler* network_config_handler_;
61
62 scoped_ptr<chromeos::CertificateHandler> certificate_handler_;
63
57 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdaterImpl); 64 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdaterImpl);
58 }; 65 };
59 66
60 } // namespace policy 67 } // namespace policy
61 68
62 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_ 69 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698