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

Side by Side Diff: chromeos/network/policy_util.h

Issue 510123004: Apply global auto connect ONC policy in GetManagedProperties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMEOS_NETWORK_POLICY_UTIL_H_ 5 #ifndef CHROMEOS_NETWORK_POLICY_UTIL_H_
6 #define CHROMEOS_NETWORK_POLICY_UTIL_H_ 6 #define CHROMEOS_NETWORK_POLICY_UTIL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 12
13 namespace base { 13 namespace base {
14 class DictionaryValue; 14 class DictionaryValue;
15 } 15 }
16 16
17 namespace chromeos { 17 namespace chromeos {
18 18
19 struct NetworkProfile; 19 struct NetworkProfile;
20 20
21 namespace policy_util { 21 namespace policy_util {
22 22
23 typedef std::map<std::string, const base::DictionaryValue*> GuidToPolicyMap; 23 typedef std::map<std::string, const base::DictionaryValue*> GuidToPolicyMap;
24 24
25 scoped_ptr<base::DictionaryValue> CreateManagedONC(
stevenjb 2014/08/28 16:19:41 At some point we should document the "ManagedONC"
pneubeck (no reviews) 2014/08/29 16:22:21 Created a bug.
26 const base::DictionaryValue* global_policy,
27 const base::DictionaryValue* network_policy,
28 const base::DictionaryValue* user_settings,
29 const base::DictionaryValue* active_settings,
30 const NetworkProfile* profile);
31
32 // Adds properties to |properties_to_update|, which are enforced on an
33 // unamaged network by the global network config of the policy.
34 // |entry_properties| are the network's current properties read from its
35 // profile entry.
stevenjb 2014/08/28 16:19:41 Alignment
pneubeck (no reviews) 2014/08/29 16:22:21 Done.
36 void SetShillPropertiesForGlobalPolicy(
37 const base::DictionaryValue& shill_dictionary,
38 const base::DictionaryValue* global_network_policy,
39 base::DictionaryValue* shill_properties_to_update);
40
25 // Creates a Shill property dictionary from the given arguments. The resulting 41 // Creates a Shill property dictionary from the given arguments. The resulting
26 // dictionary will be sent to Shill by the caller. Depending on the profile 42 // dictionary will be sent to Shill by the caller. Depending on the profile
27 // type, |policy| is interpreted as the user or device policy and |settings| as 43 // type, |network_policy| is interpreted as the user or device policy and
28 // the user or shared settings. |policy| or |settings| can be NULL, but not 44 // |user_settings| as the user or shared settings. |network_policy| or
29 // both. 45 // |user_settings| can be NULL, but not both.
30 scoped_ptr<base::DictionaryValue> CreateShillConfiguration( 46 scoped_ptr<base::DictionaryValue> CreateShillConfiguration(
31 const NetworkProfile& profile, 47 const NetworkProfile& profile,
32 const std::string& guid, 48 const std::string& guid,
33 const base::DictionaryValue* policy, 49 const base::DictionaryValue* global_policy,
34 const base::DictionaryValue* settings); 50 const base::DictionaryValue* network_policy,
51 const base::DictionaryValue* user_settings);
35 52
36 // Returns the policy from |policies| matching |actual_network|, if any exists. 53 // Returns the policy from |policies| matching |actual_network|, if any exists.
37 // Returns NULL otherwise. |actual_network| must be part of a ONC 54 // Returns NULL otherwise. |actual_network| must be part of a ONC
38 // NetworkConfiguration. 55 // NetworkConfiguration.
39 const base::DictionaryValue* FindMatchingPolicy( 56 const base::DictionaryValue* FindMatchingPolicy(
40 const GuidToPolicyMap& policies, 57 const GuidToPolicyMap& policies,
41 const base::DictionaryValue& actual_network); 58 const base::DictionaryValue& actual_network);
42 59
43 } // namespace policy_util 60 } // namespace policy_util
44 61
45 } // namespace chromeos 62 } // namespace chromeos
46 63
47 #endif // CHROMEOS_NETWORK_POLICY_UTIL_H_ 64 #endif // CHROMEOS_NETWORK_POLICY_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698