Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Implementation of helper functions for the Chrome Extensions Proxy Settings | 5 // Implementation of helper functions for the Chrome Extensions Proxy Settings |
| 6 // API. | 6 // API. |
| 7 // | 7 // |
| 8 // Throughout this code, we report errors to the user by setting an |error| | 8 // Throughout this code, we report errors to the user by setting an |error| |
| 9 // parameter, if and only if these errors can be cause by invalid input | 9 // parameter, if and only if these errors can be cause by invalid input |
| 10 // from the extension and we cannot expect that the extensions API has | 10 // from the extension and we cannot expect that the extensions API has |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 429 | 429 |
| 430 base::DictionaryValue* CreateProxyServerDict(const net::ProxyServer& proxy) { | 430 base::DictionaryValue* CreateProxyServerDict(const net::ProxyServer& proxy) { |
| 431 scoped_ptr<base::DictionaryValue> out(new base::DictionaryValue); | 431 scoped_ptr<base::DictionaryValue> out(new base::DictionaryValue); |
| 432 switch (proxy.scheme()) { | 432 switch (proxy.scheme()) { |
| 433 case net::ProxyServer::SCHEME_HTTP: | 433 case net::ProxyServer::SCHEME_HTTP: |
| 434 out->SetString(keys::kProxyConfigRuleScheme, "http"); | 434 out->SetString(keys::kProxyConfigRuleScheme, "http"); |
| 435 break; | 435 break; |
| 436 case net::ProxyServer::SCHEME_HTTPS: | 436 case net::ProxyServer::SCHEME_HTTPS: |
| 437 out->SetString(keys::kProxyConfigRuleScheme, "https"); | 437 out->SetString(keys::kProxyConfigRuleScheme, "https"); |
| 438 break; | 438 break; |
| 439 case net::ProxyServer::SCHEME_QUIC: | |
| 440 out->SetString(keys::kProxyConfigRuleScheme, "quic"); | |
| 441 break; | |
|
battre
2014/02/03 10:14:57
I think there is a little bit more work to the pro
Ryan Hamilton
2014/02/03 22:28:38
Ah, I see. Done. (I hope)
| |
| 439 case net::ProxyServer::SCHEME_SOCKS4: | 442 case net::ProxyServer::SCHEME_SOCKS4: |
| 440 out->SetString(keys::kProxyConfigRuleScheme, "socks4"); | 443 out->SetString(keys::kProxyConfigRuleScheme, "socks4"); |
| 441 break; | 444 break; |
| 442 case net::ProxyServer::SCHEME_SOCKS5: | 445 case net::ProxyServer::SCHEME_SOCKS5: |
| 443 out->SetString(keys::kProxyConfigRuleScheme, "socks5"); | 446 out->SetString(keys::kProxyConfigRuleScheme, "socks5"); |
| 444 break; | 447 break; |
| 445 case net::ProxyServer::SCHEME_DIRECT: | 448 case net::ProxyServer::SCHEME_DIRECT: |
| 446 case net::ProxyServer::SCHEME_INVALID: | 449 case net::ProxyServer::SCHEME_INVALID: |
| 447 NOTREACHED(); | 450 NOTREACHED(); |
| 448 return NULL; | 451 return NULL; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 488 const std::string& delims) { | 491 const std::string& delims) { |
| 489 base::ListValue* out = new base::ListValue; | 492 base::ListValue* out = new base::ListValue; |
| 490 base::StringTokenizer entries(in, delims); | 493 base::StringTokenizer entries(in, delims); |
| 491 while (entries.GetNext()) | 494 while (entries.GetNext()) |
| 492 out->Append(new base::StringValue(entries.token())); | 495 out->Append(new base::StringValue(entries.token())); |
| 493 return out; | 496 return out; |
| 494 } | 497 } |
| 495 | 498 |
| 496 } // namespace proxy_api_helpers | 499 } // namespace proxy_api_helpers |
| 497 } // namespace extensions | 500 } // namespace extensions |
| OLD | NEW |