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

Unified Diff: chrome/browser/policy/network_configuration_updater.h

Issue 10386176: Revert "Refactored NetworkConfigurationUpdater to read policy from the PolicyService." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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/policy/network_configuration_updater.h
diff --git a/chrome/browser/policy/network_configuration_updater.h b/chrome/browser/policy/network_configuration_updater.h
index 4fd651cc2d20242f5e62b768f9e6f17bad51643b..648e23f40df2b176e5dc9f78fc230137217500af 100644
--- a/chrome/browser/policy/network_configuration_updater.h
+++ b/chrome/browser/policy/network_configuration_updater.h
@@ -9,11 +9,7 @@
#include <string>
#include "chrome/browser/chromeos/cros/network_ui_data.h"
-#include "chrome/browser/policy/policy_service.h"
-
-namespace base {
-class Value;
-}
+#include "chrome/browser/policy/configuration_policy_provider.h"
namespace chromeos {
class NetworkLibrary;
@@ -25,26 +21,33 @@ class PolicyMap;
// Keeps track of the network configuration policy settings and updates the
// network definitions whenever the configuration changes.
-class NetworkConfigurationUpdater {
+class NetworkConfigurationUpdater
+ : public ConfigurationPolicyProvider::Observer {
public:
- NetworkConfigurationUpdater(PolicyService* policy_service,
+ NetworkConfigurationUpdater(ConfigurationPolicyProvider* provider,
chromeos::NetworkLibrary* network_library);
virtual ~NetworkConfigurationUpdater();
+ // ConfigurationPolicyProvider::Observer:
+ virtual void OnUpdatePolicy(ConfigurationPolicyProvider* provider) OVERRIDE;
+
// Empty network configuration blob.
static const char kEmptyConfiguration[];
private:
+ // Grabs network configuration from policy and applies it.
+ void Update();
+
// Extracts ONC string from |policy_map| and pushes the configuration to
// |network_library_| if it's different from |*cached_value| (which is
// updated).
- void ApplyNetworkConfiguration(chromeos::NetworkUIData::ONCSource onc_source,
- std::string* cached_value,
- const base::Value* previous,
- const base::Value* current);
+ void ApplyNetworkConfiguration(const PolicyMap& policy_map,
+ const char* policy_name,
+ chromeos::NetworkUIData::ONCSource onc_source,
+ std::string* cached_value);
- // Wraps the policy service we read network configuration from.
- PolicyChangeRegistrar policy_change_registrar_;
+ // Wraps the provider we read network configuration from.
+ ConfigurationPolicyObserverRegistrar provider_registrar_;
// Network library to write network configuration to.
chromeos::NetworkLibrary* network_library_;
« no previous file with comments | « chrome/browser/policy/browser_policy_connector.cc ('k') | chrome/browser/policy/network_configuration_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698