Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER2_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER2_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "chrome/browser/policy/policy_service.h" | |
| 11 #include "chromeos/network/onc/onc_constants.h" | |
| 12 | |
| 13 namespace base { | |
| 14 class Value; | |
| 15 } | |
| 16 | |
| 17 namespace policy { | |
| 18 | |
| 19 class PolicyMap; | |
| 20 | |
| 21 // Keeps track of the network configuration policy settings and Shill's | |
| 22 // profiles. Requests the NetworkLibrary to apply the ONC of the network | |
|
stevenjb
2013/04/11 18:20:08
This version doesn't use NetworkLibrary, right?
pneubeck (no reviews)
2013/04/15 12:16:24
I will write write 100 times "You shall not copy a
| |
| 23 // policies every time one of the relevant policies or Shill's profiles changes | |
| 24 // or OnUserPolicyInitialized() is called. If the user policy is available, | |
| 25 // always both the device and the user policy are applied. Otherwise only the | |
| 26 // device policy is applied. | |
| 27 class NetworkConfigurationUpdater2 { | |
|
pastarmovj
2013/04/11 14:46:29
Please make NetworkConfigurationUpdater2 and etwor
stevenjb
2013/04/11 18:20:08
Agreed that we should use a pure virtual base clas
pneubeck (no reviews)
2013/04/15 12:16:24
Done. The only thing I didn't rename is the test f
pneubeck (no reviews)
2013/04/15 12:16:24
Done.
| |
| 28 public: | |
| 29 explicit NetworkConfigurationUpdater2(PolicyService* policy_service); | |
| 30 virtual ~NetworkConfigurationUpdater2(); | |
| 31 | |
| 32 void OnUserPolicyInitialized(); | |
| 33 | |
| 34 private: | |
| 35 // Callback that's called by |policy_service_| if the respective ONC policy | |
| 36 // changed. | |
| 37 void OnPolicyChanged(chromeos::onc::ONCSource onc_source, | |
| 38 const base::Value* previous, | |
| 39 const base::Value* current); | |
| 40 | |
| 41 void ApplyNetworkConfiguration(chromeos::onc::ONCSource onc_source); | |
| 42 | |
| 43 // Whether the user policy is already available. | |
| 44 bool user_policy_initialized_; | |
| 45 | |
| 46 // Wraps the policy service we read network configuration from. | |
| 47 PolicyChangeRegistrar policy_change_registrar_; | |
| 48 | |
| 49 // The policy service storing the ONC policies. | |
| 50 PolicyService* policy_service_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(NetworkConfigurationUpdater2); | |
| 53 }; | |
| 54 | |
| 55 } // namespace policy | |
| 56 | |
| 57 #endif // CHROME_BROWSER_CHROMEOS_POLICY_NETWORK_CONFIGURATION_UPDATER2_H_ | |
| OLD | NEW |