Index: chrome/browser/chromeos/cros/network_library_impl_base.cc |
diff --git a/chrome/browser/chromeos/cros/network_library_impl_base.cc b/chrome/browser/chromeos/cros/network_library_impl_base.cc |
index 768af924d1b0e5fe5e3ee7d049a360b7a4e15146..450085f4b6a8e833458d61a455f4a0f9108de2b0 100644 |
--- a/chrome/browser/chromeos/cros/network_library_impl_base.cc |
+++ b/chrome/browser/chromeos/cros/network_library_impl_base.cc |
@@ -1085,6 +1085,8 @@ bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob, |
return false; |
} |
+ bool error_occurred = false; |
stevenjb
2012/12/14 01:09:16
nit: 'success = true' would match the return value
|
+ |
const base::ListValue* certificates; |
bool has_certificates = |
root_dict->GetListWithoutPathExpansion(onc::kCertificates, &certificates); |
@@ -1101,8 +1103,8 @@ bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob, |
if (cert_importer.ParseAndStoreCertificates(*certificates) != |
onc::CertificateImporter::IMPORT_OK) { |
LOG(ERROR) << "Cannot parse some of the certificates in the ONC from " |
- << onc::GetSourceAsString(source); |
- return false; |
+ << onc::GetSourceAsString(source); |
+ error_occurred = true; |
} |
} |
@@ -1123,7 +1125,8 @@ bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob, |
if (!network) { |
LOG(ERROR) << "Error during ONC parsing network at index " << i |
<< " from " << onc::GetSourceAsString(source); |
- return false; |
+ error_occurred = true; |
+ continue; |
} |
// Disallow anything but WiFi and Ethernet for device-level policy (which |
@@ -1210,14 +1213,11 @@ bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob, |
// ONC blob. We first collect the networks and do the actual deletion later |
// because ForgetNetwork() changes the remembered network vectors. |
ForgetNetworksById(source, network_ids, false); |
- } else if (source == onc::ONC_SOURCE_USER_IMPORT) { |
- if (removal_ids.empty()) |
- return true; |
- |
+ } else if (source == onc::ONC_SOURCE_USER_IMPORT && !removal_ids.empty()) { |
ForgetNetworksById(source, removal_ids, true); |
} |
- return true; |
+ return !error_occurred; |
} |
//////////////////////////////////////////////////////////////////////////// |