proxy_info.cc revision c7f5f8508d98d5952d42ed7648c2a8f30a4da156
1// Copyright (c) 2006-2008 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#include "net/proxy/proxy_info.h"
6
7namespace net {
8
9ProxyInfo::ProxyInfo() : config_id_(ProxyConfig::INVALID_ID) {
10}
11
12void ProxyInfo::Use(const ProxyInfo& other) {
13  proxy_list_ = other.proxy_list_;
14}
15
16void ProxyInfo::UseDirect() {
17  proxy_list_.SetSingleProxyServer(ProxyServer::Direct());
18}
19
20void ProxyInfo::UseNamedProxy(const std::string& proxy_uri_list) {
21  proxy_list_.Set(proxy_uri_list);
22}
23
24void ProxyInfo::UseProxyServer(const ProxyServer& proxy_server) {
25  proxy_list_.SetSingleProxyServer(proxy_server);
26}
27
28std::string ProxyInfo::ToPacString() const {
29  return proxy_list_.ToPacString();
30}
31
32}  // namespace net
33