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

Unified Diff: chrome/browser/extensions/api/proxy/proxy_api_helpers.cc

Issue 12315019: Change ProxyRules to handle ProxyLists rather than just single ProxyServer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/proxy/proxy_api_helpers.cc
diff --git a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc
index 11e45fd2e665abf996652412096408c67e55ec4e..564376ca756ba40f147c43a4fd8252cd34819b57 100644
--- a/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc
+++ b/chrome/browser/extensions/api/proxy/proxy_api_helpers.cc
@@ -377,28 +377,32 @@ DictionaryValue* CreateProxyRulesDict(
case net::ProxyConfig::ProxyRules::TYPE_NO_RULES:
return NULL;
case net::ProxyConfig::ProxyRules::TYPE_SINGLE_PROXY:
- if (rules.single_proxy.is_valid()) {
- extension_proxy_rules->Set(keys::field_name[keys::SCHEME_ALL],
- CreateProxyServerDict(rules.single_proxy));
+ if (!rules.single_proxies.IsEmpty()) {
+ extension_proxy_rules->Set(
+ keys::field_name[keys::SCHEME_ALL],
+ CreateProxyServerDict(rules.single_proxies.Get()));
}
break;
case net::ProxyConfig::ProxyRules::TYPE_PROXY_PER_SCHEME:
- if (rules.proxy_for_http.is_valid()) {
- extension_proxy_rules->Set(keys::field_name[keys::SCHEME_HTTP],
- CreateProxyServerDict(rules.proxy_for_http));
+ if (!rules.proxies_for_http.IsEmpty()) {
+ extension_proxy_rules->Set(
+ keys::field_name[keys::SCHEME_HTTP],
+ CreateProxyServerDict(rules.proxies_for_http.Get()));
}
- if (rules.proxy_for_https.is_valid()) {
+ if (!rules.proxies_for_https.IsEmpty()) {
extension_proxy_rules->Set(
keys::field_name[keys::SCHEME_HTTPS],
- CreateProxyServerDict(rules.proxy_for_https));
+ CreateProxyServerDict(rules.proxies_for_https.Get()));
}
- if (rules.proxy_for_ftp.is_valid()) {
- extension_proxy_rules->Set(keys::field_name[keys::SCHEME_FTP],
- CreateProxyServerDict(rules.proxy_for_ftp));
+ if (!rules.proxies_for_ftp.IsEmpty()) {
+ extension_proxy_rules->Set(
+ keys::field_name[keys::SCHEME_FTP],
+ CreateProxyServerDict(rules.proxies_for_ftp.Get()));
}
- if (rules.fallback_proxy.is_valid()) {
- extension_proxy_rules->Set(keys::field_name[keys::SCHEME_FALLBACK],
- CreateProxyServerDict(rules.fallback_proxy));
+ if (!rules.fallback_proxies.IsEmpty()) {
+ extension_proxy_rules->Set(
+ keys::field_name[keys::SCHEME_FALLBACK],
+ CreateProxyServerDict(rules.fallback_proxies.Get()));
}
break;
}

Powered by Google App Engine
This is Rietveld 408576698