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

Unified Diff: chromeos/network/managed_network_configuration_handler.h

Issue 12676017: Adding policy support to the new network configuration stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments to local helper functions and fixed some nits. 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/network/managed_network_configuration_handler.h
diff --git a/chromeos/network/managed_network_configuration_handler.h b/chromeos/network/managed_network_configuration_handler.h
index 76fd02cbc7f20e175dbcb5ccfe653fcd4a7cbf8d..b53ba25f39bc22cfa83bbf018028f6d82c05c15d 100644
--- a/chromeos/network/managed_network_configuration_handler.h
+++ b/chromeos/network/managed_network_configuration_handler.h
@@ -5,14 +5,16 @@
#ifndef CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_
#define CHROMEOS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_
+#include <map>
#include <string>
-#include <vector>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/gtest_prod_util.h"
+#include "base/memory/weak_ptr.h"
#include "chromeos/chromeos_export.h"
#include "chromeos/network/network_handler_callbacks.h"
+#include "chromeos/network/onc/onc_constants.h"
namespace base {
class DictionaryValue;
@@ -67,6 +69,13 @@ class CHROMEOS_EXPORT ManagedNetworkConfigurationHandler {
const network_handler::DictionaryResultCallback& callback,
const network_handler::ErrorCallback& error_callback) const;
+ // Provides the managed properties of the network with |service_path| to
+ // |callback|.
+ void GetManagedProperties(
+ const std::string& service_path,
+ const network_handler::DictionaryResultCallback& callback,
+ const network_handler::ErrorCallback& error_callback);
+
// Sets the user's settings of an already configured network with
// |service_path|. A network can be initially configured by calling
// CreateConfiguration or if it is managed by a policy. The given properties
@@ -74,7 +83,7 @@ class CHROMEOS_EXPORT ManagedNetworkConfigurationHandler {
// properties.
void SetProperties(
const std::string& service_path,
- const base::DictionaryValue& properties,
+ const base::DictionaryValue& user_settings,
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) const;
@@ -109,10 +118,35 @@ class CHROMEOS_EXPORT ManagedNetworkConfigurationHandler {
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) const;
+ // Only to be called by NetworkConfigurationUpdater.
+ void SetPolicy(onc::ONCSource onc_source,
+ const base::DictionaryValue& onc_dict);
+
private:
+ typedef std::map<std::string, const base::DictionaryValue*> PolicyMap;
+
+ class PolicyApplicator;
+
ManagedNetworkConfigurationHandler();
~ManagedNetworkConfigurationHandler();
+ void GetManagedPropertiesCallback(
+ const network_handler::DictionaryResultCallback& callback,
+ const network_handler::ErrorCallback& error_callback,
+ const std::string& service_path,
+ const base::DictionaryValue& shill_properties);
+
+ const PolicyMap &GetPoliciesForProfile(const std::string& profile) const;
+
+ bool user_policy_initialized_;
+ bool device_policy_initialized_;
+
+ PolicyMap user_policies_by_guid_;
+ PolicyMap device_policies_by_guid_;
+
+ // For Shill client callbacks
+ base::WeakPtrFactory<ManagedNetworkConfigurationHandler> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ManagedNetworkConfigurationHandler);
};

Powered by Google App Engine
This is Rietveld 408576698