OLD | NEW |
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 29 matching lines...) Expand all Loading... |
40 } | 40 } |
41 | 41 |
42 bool ProxyConfigDictionary::GetProxyServer(std::string* out) const { | 42 bool ProxyConfigDictionary::GetProxyServer(std::string* out) const { |
43 return dict_->GetString(kProxyServer, out); | 43 return dict_->GetString(kProxyServer, out); |
44 } | 44 } |
45 | 45 |
46 bool ProxyConfigDictionary::GetBypassList(std::string* out) const { | 46 bool ProxyConfigDictionary::GetBypassList(std::string* out) const { |
47 return dict_->GetString(kProxyBypassList, out); | 47 return dict_->GetString(kProxyBypassList, out); |
48 } | 48 } |
49 | 49 |
| 50 bool ProxyConfigDictionary::HasBypassList() const { |
| 51 return dict_->HasKey(kProxyBypassList); |
| 52 } |
| 53 |
50 // static | 54 // static |
51 DictionaryValue* ProxyConfigDictionary::CreateDirect() { | 55 DictionaryValue* ProxyConfigDictionary::CreateDirect() { |
52 return CreateDictionary(ProxyPrefs::MODE_DIRECT, "", "", ""); | 56 return CreateDictionary(ProxyPrefs::MODE_DIRECT, "", "", ""); |
53 } | 57 } |
54 | 58 |
55 // static | 59 // static |
56 DictionaryValue* ProxyConfigDictionary::CreateAutoDetect() { | 60 DictionaryValue* ProxyConfigDictionary::CreateAutoDetect() { |
57 return CreateDictionary(ProxyPrefs::MODE_AUTO_DETECT, "", "", ""); | 61 return CreateDictionary(ProxyPrefs::MODE_AUTO_DETECT, "", "", ""); |
58 } | 62 } |
59 | 63 |
(...skipping 29 matching lines...) Expand all Loading... |
89 DictionaryValue* dict = new DictionaryValue(); | 93 DictionaryValue* dict = new DictionaryValue(); |
90 dict->SetString(kProxyMode, ProxyModeToString(mode)); | 94 dict->SetString(kProxyMode, ProxyModeToString(mode)); |
91 if (!pac_url.empty()) | 95 if (!pac_url.empty()) |
92 dict->SetString(kProxyPacUrl, pac_url); | 96 dict->SetString(kProxyPacUrl, pac_url); |
93 if (!proxy_server.empty()) | 97 if (!proxy_server.empty()) |
94 dict->SetString(kProxyServer, proxy_server); | 98 dict->SetString(kProxyServer, proxy_server); |
95 if (!bypass_list.empty()) | 99 if (!bypass_list.empty()) |
96 dict->SetString(kProxyBypassList, bypass_list); | 100 dict->SetString(kProxyBypassList, bypass_list); |
97 return dict; | 101 return dict; |
98 } | 102 } |
OLD | NEW |