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 #include "chromeos/network/onc/onc_utils.h" | 5 #include "chromeos/network/onc/onc_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chromeos/network/onc/onc_normalizer.h" | 29 #include "chromeos/network/onc/onc_normalizer.h" |
30 #include "chromeos/network/onc/onc_signature.h" | 30 #include "chromeos/network/onc/onc_signature.h" |
31 #include "chromeos/network/onc/onc_translator.h" | 31 #include "chromeos/network/onc/onc_translator.h" |
32 #include "chromeos/network/onc/onc_utils.h" | 32 #include "chromeos/network/onc/onc_utils.h" |
33 #include "chromeos/network/onc/onc_validator.h" | 33 #include "chromeos/network/onc/onc_validator.h" |
34 #include "components/device_event_log/device_event_log.h" | 34 #include "components/device_event_log/device_event_log.h" |
35 #include "components/onc/onc_pref_names.h" | 35 #include "components/onc/onc_pref_names.h" |
36 #include "components/prefs/pref_service.h" | 36 #include "components/prefs/pref_service.h" |
37 #include "components/proxy_config/proxy_config_dictionary.h" | 37 #include "components/proxy_config/proxy_config_dictionary.h" |
38 #include "components/signin/core/account_id/account_id.h" | 38 #include "components/signin/core/account_id/account_id.h" |
39 #include "components/url_formatter/url_fixer.h" | |
40 #include "components/user_manager/user.h" | 39 #include "components/user_manager/user.h" |
41 #include "components/user_manager/user_manager.h" | 40 #include "components/user_manager/user_manager.h" |
42 #include "crypto/encryptor.h" | 41 #include "crypto/encryptor.h" |
43 #include "crypto/hmac.h" | 42 #include "crypto/hmac.h" |
44 #include "crypto/symmetric_key.h" | 43 #include "crypto/symmetric_key.h" |
45 #include "net/base/host_port_pair.h" | 44 #include "net/base/host_port_pair.h" |
46 #include "net/cert/pem_tokenizer.h" | 45 #include "net/cert/pem_tokenizer.h" |
47 #include "net/cert/x509_certificate.h" | 46 #include "net/cert/x509_certificate.h" |
48 #include "net/proxy/proxy_bypass_rules.h" | 47 #include "net/proxy/proxy_bypass_rules.h" |
49 #include "net/proxy/proxy_config.h" | 48 #include "net/proxy/proxy_config.h" |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 std::unique_ptr<base::DictionaryValue> proxy_dict; | 923 std::unique_ptr<base::DictionaryValue> proxy_dict; |
925 | 924 |
926 if (type == ::onc::proxy::kDirect) { | 925 if (type == ::onc::proxy::kDirect) { |
927 proxy_dict.reset(ProxyConfigDictionary::CreateDirect()); | 926 proxy_dict.reset(ProxyConfigDictionary::CreateDirect()); |
928 } else if (type == ::onc::proxy::kWPAD) { | 927 } else if (type == ::onc::proxy::kWPAD) { |
929 proxy_dict.reset(ProxyConfigDictionary::CreateAutoDetect()); | 928 proxy_dict.reset(ProxyConfigDictionary::CreateAutoDetect()); |
930 } else if (type == ::onc::proxy::kPAC) { | 929 } else if (type == ::onc::proxy::kPAC) { |
931 std::string pac_url; | 930 std::string pac_url; |
932 onc_proxy_settings.GetStringWithoutPathExpansion(::onc::proxy::kPAC, | 931 onc_proxy_settings.GetStringWithoutPathExpansion(::onc::proxy::kPAC, |
933 &pac_url); | 932 &pac_url); |
934 GURL url(url_formatter::FixupURL(pac_url, std::string())); | 933 GURL url(pac_url); |
935 proxy_dict.reset(ProxyConfigDictionary::CreatePacScript( | 934 DCHECK(url.is_valid()) << "Invalid URL in ProxySettings.PAC"; |
936 url.is_valid() ? url.spec() : std::string(), false)); | 935 proxy_dict.reset(ProxyConfigDictionary::CreatePacScript(url.spec(), false)); |
937 } else if (type == ::onc::proxy::kManual) { | 936 } else if (type == ::onc::proxy::kManual) { |
938 const base::DictionaryValue* manual_dict = nullptr; | 937 const base::DictionaryValue* manual_dict = nullptr; |
939 onc_proxy_settings.GetDictionaryWithoutPathExpansion(::onc::proxy::kManual, | 938 onc_proxy_settings.GetDictionaryWithoutPathExpansion(::onc::proxy::kManual, |
940 &manual_dict); | 939 &manual_dict); |
941 std::string manual_spec; | 940 std::string manual_spec; |
942 AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kFtp, &manual_spec); | 941 AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kFtp, &manual_spec); |
943 AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kHttp, &manual_spec); | 942 AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kHttp, &manual_spec); |
944 AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kSocks, | 943 AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kSocks, |
945 &manual_spec); | 944 &manual_spec); |
946 AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kHttps, | 945 AppendProxyServerForScheme(*manual_dict, ::onc::proxy::kHttps, |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 const PrefService* local_state_prefs, | 1318 const PrefService* local_state_prefs, |
1320 const NetworkState& network) { | 1319 const NetworkState& network) { |
1321 ::onc::ONCSource ignored_onc_source; | 1320 ::onc::ONCSource ignored_onc_source; |
1322 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( | 1321 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( |
1323 profile_prefs, local_state_prefs, network, &ignored_onc_source); | 1322 profile_prefs, local_state_prefs, network, &ignored_onc_source); |
1324 return policy != NULL; | 1323 return policy != NULL; |
1325 } | 1324 } |
1326 | 1325 |
1327 } // namespace onc | 1326 } // namespace onc |
1328 } // namespace chromeos | 1327 } // namespace chromeos |
OLD | NEW |