| 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 "components/onc/onc_constants.h" | 11 #include "components/onc/onc_constants.h" |
| 12 | 12 |
| 13 class PrefService; | 13 class PrefService; |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class DictionaryValue; | 16 class DictionaryValue; |
| 17 class ListValue; | 17 class ListValue; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace chromeos { | 20 namespace chromeos { |
| 21 | 21 |
| 22 class FavoriteState; | |
| 23 class NetworkState; | 22 class NetworkState; |
| 24 class User; | 23 class User; |
| 25 | 24 |
| 26 namespace onc { | 25 namespace onc { |
| 27 | 26 |
| 28 // Translates |onc_proxy_settings|, which has to be a valid ONC ProxySettings | 27 // Translates |onc_proxy_settings|, which has to be a valid ONC ProxySettings |
| 29 // dictionary, to a ProxyConfig dictionary (see | 28 // dictionary, to a ProxyConfig dictionary (see |
| 30 // chrome/browser/prefs/proxy_config_dictionary.h). | 29 // chrome/browser/prefs/proxy_config_dictionary.h). |
| 31 // | 30 // |
| 32 // This function is used to translate ONC ProxySettings to the "ProxyConfig" | 31 // This function is used to translate ONC ProxySettings to the "ProxyConfig" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 56 | 55 |
| 57 // Returns the global network configuration section of the active user's network | 56 // Returns the global network configuration section of the active user's network |
| 58 // policy (if |for_active_user| is true) or of the device policy. | 57 // policy (if |for_active_user| is true) or of the device policy. |
| 59 const base::DictionaryValue* GetGlobalConfigFromPolicy(bool for_active_user); | 58 const base::DictionaryValue* GetGlobalConfigFromPolicy(bool for_active_user); |
| 60 | 59 |
| 61 // Convenvience function to retrieve the "AllowOnlyPolicyNetworksToAutoconnect" | 60 // Convenvience function to retrieve the "AllowOnlyPolicyNetworksToAutoconnect" |
| 62 // setting from the global network configuration (see | 61 // setting from the global network configuration (see |
| 63 // GetGlobalConfigFromPolicy). | 62 // GetGlobalConfigFromPolicy). |
| 64 bool PolicyAllowsOnlyPolicyNetworksToAutoconnect(bool for_active_user); | 63 bool PolicyAllowsOnlyPolicyNetworksToAutoconnect(bool for_active_user); |
| 65 | 64 |
| 66 // Returns the effective (user or device) policy for network |favorite|. Both | 65 // Returns the effective (user or device) policy for network |network|. Both |
| 67 // |profile_prefs| and |local_state_prefs| might be NULL. Returns NULL if no | 66 // |profile_prefs| and |local_state_prefs| might be NULL. Returns NULL if no |
| 68 // applicable policy is found. Sets |onc_source| accordingly. | 67 // applicable policy is found. Sets |onc_source| accordingly. |
| 69 const base::DictionaryValue* GetPolicyForFavoriteNetwork( | 68 const base::DictionaryValue* GetPolicyForNetwork( |
| 70 const PrefService* profile_prefs, | 69 const PrefService* profile_prefs, |
| 71 const PrefService* local_state_prefs, | 70 const PrefService* local_state_prefs, |
| 72 const FavoriteState& favorite, | 71 const NetworkState& network, |
| 73 ::onc::ONCSource* onc_source); | 72 ::onc::ONCSource* onc_source); |
| 74 | 73 |
| 75 // Convenience function to check only whether a policy for a network exists. | 74 // Convenience function to check only whether a policy for a network exists. |
| 76 bool HasPolicyForFavoriteNetwork(const PrefService* profile_prefs, | 75 bool HasPolicyForNetwork(const PrefService* profile_prefs, |
| 77 const PrefService* local_state_prefs, | 76 const PrefService* local_state_prefs, |
| 78 const FavoriteState& network); | 77 const NetworkState& network); |
| 79 | 78 |
| 80 } // namespace onc | 79 } // namespace onc |
| 81 } // namespace chromeos | 80 } // namespace chromeos |
| 82 | 81 |
| 83 #endif // CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ | 82 #endif // CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ |
| OLD | NEW |