OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/networking_private/networking_private_chromeos.
h" | 5 #include "extensions/browser/api/networking_private/networking_private_chromeos.
h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 EnsureDictionaryValue(::onc::proxy::kManual, proxy_settings); | 853 EnsureDictionaryValue(::onc::proxy::kManual, proxy_settings); |
854 SetManualProxy(manual, state, ::onc::proxy::kHttp, config.single_proxy); | 854 SetManualProxy(manual, state, ::onc::proxy::kHttp, config.single_proxy); |
855 SetManualProxy(manual, state, ::onc::proxy::kHttps, config.single_proxy); | 855 SetManualProxy(manual, state, ::onc::proxy::kHttps, config.single_proxy); |
856 SetManualProxy(manual, state, ::onc::proxy::kFtp, config.single_proxy); | 856 SetManualProxy(manual, state, ::onc::proxy::kFtp, config.single_proxy); |
857 SetManualProxy(manual, state, ::onc::proxy::kSocks, config.single_proxy); | 857 SetManualProxy(manual, state, ::onc::proxy::kSocks, config.single_proxy); |
858 break; | 858 break; |
859 } | 859 } |
860 case UIProxyConfig::MODE_PROXY_PER_SCHEME: { | 860 case UIProxyConfig::MODE_PROXY_PER_SCHEME: { |
861 base::DictionaryValue* manual = | 861 base::DictionaryValue* manual = |
862 EnsureDictionaryValue(::onc::proxy::kManual, proxy_settings); | 862 EnsureDictionaryValue(::onc::proxy::kManual, proxy_settings); |
863 SetManualProxy(manual, state, ::onc::proxy::kHttp, config.http_proxy); | 863 if (config.http_proxy.server.is_valid()) |
864 SetManualProxy(manual, state, ::onc::proxy::kHttps, config.https_proxy); | 864 SetManualProxy(manual, state, ::onc::proxy::kHttp, config.http_proxy); |
865 SetManualProxy(manual, state, ::onc::proxy::kFtp, config.ftp_proxy); | 865 if (config.https_proxy.server.is_valid()) |
866 SetManualProxy(manual, state, ::onc::proxy::kSocks, config.socks_proxy); | 866 SetManualProxy(manual, state, ::onc::proxy::kHttps, config.https_proxy); |
| 867 if (config.ftp_proxy.server.is_valid()) |
| 868 SetManualProxy(manual, state, ::onc::proxy::kFtp, config.ftp_proxy); |
| 869 if (config.socks_proxy.server.is_valid()) |
| 870 SetManualProxy(manual, state, ::onc::proxy::kSocks, config.socks_proxy); |
867 break; | 871 break; |
868 } | 872 } |
869 case UIProxyConfig::MODE_PAC_SCRIPT: { | 873 case UIProxyConfig::MODE_PAC_SCRIPT: { |
870 base::DictionaryValue* pac = | 874 base::DictionaryValue* pac = |
871 EnsureDictionaryValue(::onc::proxy::kPAC, proxy_settings); | 875 EnsureDictionaryValue(::onc::proxy::kPAC, proxy_settings); |
872 SetProxyEffectiveValue(pac, state, | 876 SetProxyEffectiveValue(pac, state, |
873 base::WrapUnique<base::Value>(new base::Value( | 877 base::WrapUnique<base::Value>(new base::Value( |
874 config.automatic_proxy.pac_url.spec()))); | 878 config.automatic_proxy.pac_url.spec()))); |
875 break; | 879 break; |
876 } | 880 } |
877 case UIProxyConfig::MODE_DIRECT: | 881 case UIProxyConfig::MODE_DIRECT: |
878 case UIProxyConfig::MODE_AUTO_DETECT: | 882 case UIProxyConfig::MODE_AUTO_DETECT: |
879 break; | 883 break; |
880 } | 884 } |
881 | 885 |
882 VLOG(2) << " NEW PROXY: " << *proxy_settings; | 886 VLOG(2) << " NEW PROXY: " << *proxy_settings; |
883 } | 887 } |
884 | 888 |
885 } // namespace extensions | 889 } // namespace extensions |
OLD | NEW |