Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chromeos / network / policy_util.h
index c931399..841c001 100644 (file)
@@ -22,16 +22,38 @@ namespace policy_util {
 
 typedef std::map<std::string, const base::DictionaryValue*> GuidToPolicyMap;
 
+// Creates a managed ONC dictionary from the given arguments. Depending on the
+// profile type, the policies are assumed to come from the user or device policy
+// and and |user_settings| to be the user's non-shared or shared settings.
+// Each of the arguments can be NULL.
+// TODO(pneubeck): Add documentation of the returned format, see
+//   https://crbug.com/408990 .
+scoped_ptr<base::DictionaryValue> CreateManagedONC(
+    const base::DictionaryValue* global_policy,
+    const base::DictionaryValue* network_policy,
+    const base::DictionaryValue* user_settings,
+    const base::DictionaryValue* active_settings,
+    const NetworkProfile* profile);
+
+// Adds properties to |shill_properties_to_update|, which are enforced on an
+// unamaged network by the global config |global_network_policy| of the policy.
+// |shill_dictionary| are the network's current properties read from Shill.
+void SetShillPropertiesForGlobalPolicy(
+    const base::DictionaryValue& shill_dictionary,
+    const base::DictionaryValue& global_network_policy,
+    base::DictionaryValue* shill_properties_to_update);
+
 // Creates a Shill property dictionary from the given arguments. The resulting
 // dictionary will be sent to Shill by the caller. Depending on the profile
-// type, |policy| is interpreted as the user or device policy and |settings| as
-// the user or shared settings. |policy| or |settings| can be NULL, but not
-// both.
+// type, |network_policy| is interpreted as the user or device policy and
+// |user_settings| as the user or shared settings. |network_policy| or
+// |user_settings| can be NULL, but not both.
 scoped_ptr<base::DictionaryValue> CreateShillConfiguration(
     const NetworkProfile& profile,
     const std::string& guid,
-    const base::DictionaryValue* policy,
-    const base::DictionaryValue* settings);
+    const base::DictionaryValue* global_policy,
+    const base::DictionaryValue* network_policy,
+    const base::DictionaryValue* user_settings);
 
 // Returns the policy from |policies| matching |actual_network|, if any exists.
 // Returns NULL otherwise. |actual_network| must be part of a ONC