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

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

Issue 10377115: Refactored NetworkConfigurationUpdater to read policy from the PolicyService. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased 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 648e23f40df2b176e5dc9f78fc230137217500af..4fd651cc2d20242f5e62b768f9e6f17bad51643b 100644
--- a/chrome/browser/policy/network_configuration_updater.h
+++ b/chrome/browser/policy/network_configuration_updater.h
@@ -9,7 +9,11 @@
#include <string>
#include "chrome/browser/chromeos/cros/network_ui_data.h"
-#include "chrome/browser/policy/configuration_policy_provider.h"
+#include "chrome/browser/policy/policy_service.h"
+
+namespace base {
+class Value;
+}
namespace chromeos {
class NetworkLibrary;
@@ -21,33 +25,26 @@ class PolicyMap;
// Keeps track of the network configuration policy settings and updates the
// network definitions whenever the configuration changes.
-class NetworkConfigurationUpdater
- : public ConfigurationPolicyProvider::Observer {
+class NetworkConfigurationUpdater {
public:
- NetworkConfigurationUpdater(ConfigurationPolicyProvider* provider,
+ NetworkConfigurationUpdater(PolicyService* policy_service,
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(const PolicyMap& policy_map,
- const char* policy_name,
- chromeos::NetworkUIData::ONCSource onc_source,
- std::string* cached_value);
+ void ApplyNetworkConfiguration(chromeos::NetworkUIData::ONCSource onc_source,
+ std::string* cached_value,
+ const base::Value* previous,
+ const base::Value* current);
- // Wraps the provider we read network configuration from.
- ConfigurationPolicyObserverRegistrar provider_registrar_;
+ // Wraps the policy service we read network configuration from.
+ PolicyChangeRegistrar policy_change_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