| Index: chrome/browser/chromeos/net/onc_utils.cc
 | 
| diff --git a/chrome/browser/chromeos/net/onc_utils.cc b/chrome/browser/chromeos/net/onc_utils.cc
 | 
| index 4d9d7dbdbbc51f677807b1242ef9e253cca74227..1f6b5100e46f3034381f44e1be5146069b2bfe75 100644
 | 
| --- a/chrome/browser/chromeos/net/onc_utils.cc
 | 
| +++ b/chrome/browser/chromeos/net/onc_utils.cc
 | 
| @@ -9,7 +9,6 @@
 | 
|  #include "base/logging.h"
 | 
|  #include "base/prefs/pref_service.h"
 | 
|  #include "base/values.h"
 | 
| -#include "chrome/browser/chromeos/ui_proxy_config.h"
 | 
|  #include "chrome/common/pref_names.h"
 | 
|  #include "chromeos/network/managed_network_configuration_handler.h"
 | 
|  #include "chromeos/network/network_configuration_handler.h"
 | 
| @@ -23,12 +22,8 @@
 | 
|  #include "chromeos/network/onc/onc_signature.h"
 | 
|  #include "chromeos/network/onc/onc_translator.h"
 | 
|  #include "chromeos/network/onc/onc_utils.h"
 | 
| -#include "components/proxy_config/proxy_config_dictionary.h"
 | 
|  #include "components/user_manager/user.h"
 | 
|  #include "components/user_manager/user_manager.h"
 | 
| -#include "net/base/host_port_pair.h"
 | 
| -#include "net/proxy/proxy_bypass_rules.h"
 | 
| -#include "net/proxy/proxy_server.h"
 | 
|  #include "third_party/cros_system_api/dbus/service_constants.h"
 | 
|  #include "url/gurl.h"
 | 
|  
 | 
| @@ -37,117 +32,6 @@ namespace onc {
 | 
|  
 | 
|  namespace {
 | 
|  
 | 
| -net::ProxyServer ConvertOncProxyLocationToHostPort(
 | 
| -    net::ProxyServer::Scheme default_proxy_scheme,
 | 
| -    const base::DictionaryValue& onc_proxy_location) {
 | 
| -  std::string host;
 | 
| -  onc_proxy_location.GetStringWithoutPathExpansion(::onc::proxy::kHost, &host);
 | 
| -  // Parse |host| according to the format [<scheme>"://"]<server>[":"<port>].
 | 
| -  net::ProxyServer proxy_server =
 | 
| -      net::ProxyServer::FromURI(host, default_proxy_scheme);
 | 
| -  int port = 0;
 | 
| -  onc_proxy_location.GetIntegerWithoutPathExpansion(::onc::proxy::kPort, &port);
 | 
| -
 | 
| -  // Replace the port parsed from |host| by the provided |port|.
 | 
| -  return net::ProxyServer(
 | 
| -      proxy_server.scheme(),
 | 
| -      net::HostPortPair(proxy_server.host_port_pair().host(),
 | 
| -                        static_cast<uint16>(port)));
 | 
| -}
 | 
| -
 | 
| -void AppendProxyServerForScheme(
 | 
| -    const base::DictionaryValue& onc_manual,
 | 
| -    const std::string& onc_scheme,
 | 
| -    std::string* spec) {
 | 
| -  const base::DictionaryValue* onc_proxy_location = NULL;
 | 
| -  if (!onc_manual.GetDictionaryWithoutPathExpansion(onc_scheme,
 | 
| -                                                    &onc_proxy_location)) {
 | 
| -    return;
 | 
| -  }
 | 
| -
 | 
| -  net::ProxyServer::Scheme default_proxy_scheme = net::ProxyServer::SCHEME_HTTP;
 | 
| -  std::string url_scheme;
 | 
| -  if (onc_scheme == ::onc::proxy::kFtp) {
 | 
| -    url_scheme = "ftp";
 | 
| -  } else if (onc_scheme == ::onc::proxy::kHttp) {
 | 
| -    url_scheme = "http";
 | 
| -  } else if (onc_scheme == ::onc::proxy::kHttps) {
 | 
| -    url_scheme = "https";
 | 
| -  } else if (onc_scheme == ::onc::proxy::kSocks) {
 | 
| -    default_proxy_scheme = net::ProxyServer::SCHEME_SOCKS4;
 | 
| -    url_scheme = "socks";
 | 
| -  } else {
 | 
| -    NOTREACHED();
 | 
| -  }
 | 
| -
 | 
| -  net::ProxyServer proxy_server = ConvertOncProxyLocationToHostPort(
 | 
| -      default_proxy_scheme, *onc_proxy_location);
 | 
| -
 | 
| -  UIProxyConfig::EncodeAndAppendProxyServer(url_scheme, proxy_server, spec);
 | 
| -}
 | 
| -
 | 
| -net::ProxyBypassRules ConvertOncExcludeDomainsToBypassRules(
 | 
| -    const base::ListValue& onc_exclude_domains) {
 | 
| -  net::ProxyBypassRules rules;
 | 
| -  for (base::ListValue::const_iterator it = onc_exclude_domains.begin();
 | 
| -       it != onc_exclude_domains.end(); ++it) {
 | 
| -    std::string rule;
 | 
| -    (*it)->GetAsString(&rule);
 | 
| -    rules.AddRuleFromString(rule);
 | 
| -  }
 | 
| -  return rules;
 | 
| -}
 | 
| -
 | 
| -}  // namespace
 | 
| -
 | 
| -scoped_ptr<base::DictionaryValue> ConvertOncProxySettingsToProxyConfig(
 | 
| -    const base::DictionaryValue& onc_proxy_settings) {
 | 
| -  std::string type;
 | 
| -  onc_proxy_settings.GetStringWithoutPathExpansion(::onc::proxy::kType, &type);
 | 
| -  scoped_ptr<base::DictionaryValue> proxy_dict;
 | 
| -
 | 
| -  if (type == ::onc::proxy::kDirect) {
 | 
| -    proxy_dict.reset(ProxyConfigDictionary::CreateDirect());
 | 
| -  } else if (type == ::onc::proxy::kWPAD) {
 | 
| -    proxy_dict.reset(ProxyConfigDictionary::CreateAutoDetect());
 | 
| -  } else if (type == ::onc::proxy::kPAC) {
 | 
| -    std::string pac_url;
 | 
| -    onc_proxy_settings.GetStringWithoutPathExpansion(::onc::proxy::kPAC,
 | 
| -                                                     &pac_url);
 | 
| -    GURL url(pac_url);
 | 
| -    DCHECK(url.is_valid())
 | 
| -        << "PAC field is invalid for this ProxySettings.Type";
 | 
| -    proxy_dict.reset(ProxyConfigDictionary::CreatePacScript(url.spec(),
 | 
| -                                                            false));
 | 
| -  } else if (type == ::onc::proxy::kManual) {
 | 
| -    const base::DictionaryValue* manual_dict = NULL;
 | 
| -    onc_proxy_settings.GetDictionaryWithoutPathExpansion(::onc::proxy::kManual,
 | 
| -                                                         &manual_dict);
 | 
| -    std::string manual_spec;
 | 
| -    AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kFtp, &manual_spec);
 | 
| -    AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kHttp, &manual_spec);
 | 
| -    AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kSocks,
 | 
| -                               &manual_spec);
 | 
| -    AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kHttps,
 | 
| -                               &manual_spec);
 | 
| -
 | 
| -    const base::ListValue* exclude_domains = NULL;
 | 
| -    net::ProxyBypassRules bypass_rules;
 | 
| -    if (onc_proxy_settings.GetListWithoutPathExpansion(
 | 
| -            ::onc::proxy::kExcludeDomains, &exclude_domains)) {
 | 
| -      bypass_rules.AssignFrom(
 | 
| -          ConvertOncExcludeDomainsToBypassRules(*exclude_domains));
 | 
| -    }
 | 
| -    proxy_dict.reset(ProxyConfigDictionary::CreateFixedServers(
 | 
| -        manual_spec, bypass_rules.ToString()));
 | 
| -  } else {
 | 
| -    NOTREACHED();
 | 
| -  }
 | 
| -  return proxy_dict.Pass();
 | 
| -}
 | 
| -
 | 
| -namespace {
 | 
| -
 | 
|  // This class defines which string placeholders of ONC are replaced by which
 | 
|  // user attribute.
 | 
|  class UserStringSubstitution : public chromeos::onc::StringSubstitution {
 | 
| 
 |