Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

Side by Side Diff: chrome/browser/prefs/proxy_config_dictionary.cc

Issue 16398005: Extract common per-network proxy configuration functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/prefs/proxy_config_dictionary.h" 5 #include "chrome/browser/prefs/proxy_config_dictionary.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 bool ProxyConfigDictionary::GetBypassList(std::string* out) const { 60 bool ProxyConfigDictionary::GetBypassList(std::string* out) const {
61 return dict_->GetString(kProxyBypassList, out); 61 return dict_->GetString(kProxyBypassList, out);
62 } 62 }
63 63
64 bool ProxyConfigDictionary::HasBypassList() const { 64 bool ProxyConfigDictionary::HasBypassList() const {
65 return dict_->HasKey(kProxyBypassList); 65 return dict_->HasKey(kProxyBypassList);
66 } 66 }
67 67
68 const DictionaryValue& ProxyConfigDictionary::GetDictionary() const {
69 return *dict_;
70 }
71
68 // static 72 // static
69 DictionaryValue* ProxyConfigDictionary::CreateDirect() { 73 DictionaryValue* ProxyConfigDictionary::CreateDirect() {
70 return CreateDictionary(ProxyPrefs::MODE_DIRECT, 74 return CreateDictionary(ProxyPrefs::MODE_DIRECT,
71 std::string(), 75 std::string(),
72 false, 76 false,
73 std::string(), 77 std::string(),
74 std::string()); 78 std::string());
75 } 79 }
76 80
77 // static 81 // static
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 if (!pac_url.empty()) { 134 if (!pac_url.empty()) {
131 dict->SetString(kProxyPacUrl, pac_url); 135 dict->SetString(kProxyPacUrl, pac_url);
132 dict->SetBoolean(kProxyPacMandatory, pac_mandatory); 136 dict->SetBoolean(kProxyPacMandatory, pac_mandatory);
133 } 137 }
134 if (!proxy_server.empty()) 138 if (!proxy_server.empty())
135 dict->SetString(kProxyServer, proxy_server); 139 dict->SetString(kProxyServer, proxy_server);
136 if (!bypass_list.empty()) 140 if (!bypass_list.empty())
137 dict->SetString(kProxyBypassList, bypass_list); 141 dict->SetString(kProxyBypassList, bypass_list);
138 return dict; 142 return dict;
139 } 143 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/proxy_config_dictionary.h ('k') | chrome/browser/ui/webui/chromeos/login/network_state_informer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698