OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chromeos/network/onc/onc_constants.h" | 11 #include "chromeos/network/onc/onc_constants.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class DictionaryValue; | 14 class DictionaryValue; |
15 class ListValue; | 15 class ListValue; |
16 } | 16 } |
17 | 17 |
18 namespace chromeos { | 18 namespace chromeos { |
19 | 19 |
| 20 class NetworkState; |
20 class User; | 21 class User; |
21 | 22 |
22 namespace onc { | 23 namespace onc { |
23 | 24 |
24 // Translates |onc_proxy_settings|, which has to be a valid ONC ProxySettings | 25 // Translates |onc_proxy_settings|, which has to be a valid ONC ProxySettings |
25 // dictionary, to a ProxyConfig dictionary (see | 26 // dictionary, to a ProxyConfig dictionary (see |
26 // chrome/browser/prefs/proxy_config_dictionary.h). | 27 // chrome/browser/prefs/proxy_config_dictionary.h). |
27 // | 28 // |
28 // This function is used to translate ONC ProxySettings to the "ProxyConfig" | 29 // This function is used to translate ONC ProxySettings to the "ProxyConfig" |
29 // field of the Shill configuration. | 30 // field of the Shill configuration. |
30 scoped_ptr<base::DictionaryValue> ConvertOncProxySettingsToProxyConfig( | 31 scoped_ptr<base::DictionaryValue> ConvertOncProxySettingsToProxyConfig( |
31 const base::DictionaryValue& onc_proxy_settings); | 32 const base::DictionaryValue& onc_proxy_settings); |
32 | 33 |
33 // Replaces string placeholders in |network_configs|, which must be a list of | 34 // Replaces string placeholders in |network_configs|, which must be a list of |
34 // ONC NetworkConfigurations. Currently only user name placeholders are | 35 // ONC NetworkConfigurations. Currently only user name placeholders are |
35 // implemented, which are replaced by attributes of the logged-in user with | 36 // implemented, which are replaced by attributes of the logged-in user with |
36 // |hashed_username|. | 37 // |hashed_username|. |
37 void ExpandStringPlaceholdersInNetworksForUser( | 38 void ExpandStringPlaceholdersInNetworksForUser( |
38 const chromeos::User* user, | 39 const chromeos::User* user, |
39 base::ListValue* network_configs); | 40 base::ListValue* network_configs); |
40 | 41 |
41 void ImportNetworksForUser(const chromeos::User* user, | 42 void ImportNetworksForUser(const chromeos::User* user, |
42 const base::ListValue& network_configs, | 43 const base::ListValue& network_configs, |
43 std::string* error); | 44 std::string* error); |
44 | 45 |
| 46 // Looks up the policy for |guid| for the current active user and sets |
| 47 // |onc_source| accordingly. |
| 48 const base::DictionaryValue* FindPolicyForActiveUser( |
| 49 const std::string& guid, |
| 50 onc::ONCSource* onc_source); |
| 51 |
45 } // namespace onc | 52 } // namespace onc |
46 } // namespace chromeos | 53 } // namespace chromeos |
47 | 54 |
48 #endif // CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ | 55 #endif // CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ |
OLD | NEW |