onc_utils.h revision ca12bfac764ba476d6cd062bf1dde12cc64c3f40
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 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ 6#define CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ 7 8#include <string> 9 10#include "base/memory/scoped_ptr.h" 11#include "chromeos/network/onc/onc_constants.h" 12 13namespace base { 14class DictionaryValue; 15class ListValue; 16} 17 18namespace chromeos { 19namespace onc { 20 21// Translates |onc_proxy_settings|, which has to be a valid ONC ProxySettings 22// dictionary, to a ProxyConfig dictionary (see 23// chrome/browser/prefs/proxy_config_dictionary.h). 24// 25// This function is used to translate ONC ProxySettings to the "ProxyConfig" 26// field of the Shill configuration. 27scoped_ptr<base::DictionaryValue> ConvertOncProxySettingsToProxyConfig( 28 const base::DictionaryValue& onc_proxy_settings); 29 30// Replaces string placeholders in |network_configs|, which must be a list of 31// ONC NetworkConfigurations. Currently only user name placeholders are 32// implemented, which are replaced by attributes of the logged-in user with 33// |hashed_username|. 34void ExpandStringPlaceholdersInNetworksForUser( 35 const std::string& hashed_username, 36 base::ListValue* network_configs); 37 38} // namespace onc 39} // namespace chromeos 40 41#endif // CHROME_BROWSER_CHROMEOS_NET_ONC_UTILS_H_ 42