| 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 "chrome/browser/chromeos/cros/network_library_impl_base.h" | 5 #include "chrome/browser/chromeos/cros/network_library_impl_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/chromeos/cros/native_network_parser.h" | 8 #include "chrome/browser/chromeos/cros/native_network_parser.h" |
| 9 #include "chrome/browser/chromeos/cros/onc_network_parser.h" | 9 #include "chrome/browser/chromeos/cros/onc_network_parser.h" |
| 10 #include "chrome/browser/chromeos/network_login_observer.h" | 10 #include "chrome/browser/chromeos/network_login_observer.h" |
| (...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1145 if (wifi->auto_connect()) { | 1145 if (wifi->auto_connect()) { |
| 1146 ConnectToWifiNetwork(wifi); | 1146 ConnectToWifiNetwork(wifi); |
| 1147 break; | 1147 break; |
| 1148 } | 1148 } |
| 1149 } | 1149 } |
| 1150 } | 1150 } |
| 1151 | 1151 |
| 1152 bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob, | 1152 bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob, |
| 1153 const std::string& passphrase, | 1153 const std::string& passphrase, |
| 1154 NetworkUIData::ONCSource source, | 1154 NetworkUIData::ONCSource source, |
| 1155 bool allow_web_trust_from_policy, |
| 1155 std::string* error) { | 1156 std::string* error) { |
| 1156 OncNetworkParser parser(onc_blob, passphrase, source); | 1157 OncNetworkParser parser(onc_blob, passphrase, source); |
| 1158 parser.set_allow_web_trust_from_policy(allow_web_trust_from_policy); |
| 1157 | 1159 |
| 1158 if (!parser.parse_error().empty()) { | 1160 if (!parser.parse_error().empty()) { |
| 1159 if (error) | 1161 if (error) |
| 1160 *error = parser.parse_error(); | 1162 *error = parser.parse_error(); |
| 1161 return false; | 1163 return false; |
| 1162 } | 1164 } |
| 1163 | 1165 |
| 1164 for (int i = 0; i < parser.GetCertificatesSize(); i++) { | 1166 for (int i = 0; i < parser.GetCertificatesSize(); i++) { |
| 1165 // Insert each of the available certs into the certificate DB. | 1167 // Insert each of the available certs into the certificate DB. |
| 1166 if (parser.ParseCertificate(i).get() == NULL) { | 1168 if (parser.ParseCertificate(i).get() == NULL && |
| 1169 !parser.parse_error().empty()) { |
| 1167 DLOG(WARNING) << "Cannot parse certificate in ONC file"; | 1170 DLOG(WARNING) << "Cannot parse certificate in ONC file"; |
| 1168 if (error) | 1171 if (error) |
| 1169 *error = parser.parse_error(); | 1172 *error = parser.parse_error(); |
| 1170 return false; | 1173 return false; |
| 1171 } | 1174 } |
| 1172 } | 1175 } |
| 1173 | 1176 |
| 1174 // Parse all networks. Bail out if that fails. | 1177 // Parse all networks. Bail out if that fails. |
| 1175 NetworkOncMap added_onc_map; | 1178 NetworkOncMap added_onc_map; |
| 1176 ScopedVector<Network> networks; | 1179 ScopedVector<Network> networks; |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1837 GetTpmInfo(); | 1840 GetTpmInfo(); |
| 1838 return tpm_slot_; | 1841 return tpm_slot_; |
| 1839 } | 1842 } |
| 1840 | 1843 |
| 1841 const std::string& NetworkLibraryImplBase::GetTpmPin() { | 1844 const std::string& NetworkLibraryImplBase::GetTpmPin() { |
| 1842 GetTpmInfo(); | 1845 GetTpmInfo(); |
| 1843 return tpm_pin_; | 1846 return tpm_pin_; |
| 1844 } | 1847 } |
| 1845 | 1848 |
| 1846 } // namespace chromeos | 1849 } // namespace chromeos |
| OLD | NEW |