Revert 248827 "android: Migrate old content readback to use asyn..."
[chromium-blink-merge.git] / chromeos / network / policy_util.h
blobc9313999335db8c44d7ce0ca5255f024d19bf4aa
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
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_NETWORK_POLICY_UTIL_H_
6 #define CHROMEOS_NETWORK_POLICY_UTIL_H_
8 #include <map>
9 #include <string>
11 #include "base/memory/scoped_ptr.h"
13 namespace base {
14 class DictionaryValue;
17 namespace chromeos {
19 struct NetworkProfile;
21 namespace policy_util {
23 typedef std::map<std::string, const base::DictionaryValue*> GuidToPolicyMap;
25 // 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
27 // type, |policy| is interpreted as the user or device policy and |settings| as
28 // the user or shared settings. |policy| or |settings| can be NULL, but not
29 // both.
30 scoped_ptr<base::DictionaryValue> CreateShillConfiguration(
31 const NetworkProfile& profile,
32 const std::string& guid,
33 const base::DictionaryValue* policy,
34 const base::DictionaryValue* settings);
36 // Returns the policy from |policies| matching |actual_network|, if any exists.
37 // Returns NULL otherwise. |actual_network| must be part of a ONC
38 // NetworkConfiguration.
39 const base::DictionaryValue* FindMatchingPolicy(
40 const GuidToPolicyMap& policies,
41 const base::DictionaryValue& actual_network);
43 } // namespace policy_util
45 } // namespace chromeos
47 #endif // CHROMEOS_NETWORK_POLICY_UTIL_H_