Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/policy_applicator.h" | 5 #include "chromeos/network/policy_applicator.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 const base::DictionaryValue& entry_properties) { | 103 const base::DictionaryValue& entry_properties) { |
| 104 if (!handler_) { | 104 if (!handler_) { |
| 105 LOG(WARNING) << "Handler destructed during policy application to profile " | 105 LOG(WARNING) << "Handler destructed during policy application to profile " |
| 106 << profile_.ToDebugString(); | 106 << profile_.ToDebugString(); |
| 107 return; | 107 return; |
| 108 } | 108 } |
| 109 | 109 |
| 110 VLOG(2) << "Received properties for entry " << entry << " of profile " | 110 VLOG(2) << "Received properties for entry " << entry << " of profile " |
| 111 << profile_.ToDebugString(); | 111 << profile_.ToDebugString(); |
| 112 | 112 |
| 113 scoped_ptr<NetworkUIData> ui_data = | |
| 114 shill_property_util::GetUIDataFromProperties(entry_properties); | |
| 115 | |
| 116 ::onc::ONCSource onc_source = | |
| 117 ui_data ? ui_data->onc_source() : ::onc::ONC_SOURCE_UNKNOWN; | |
| 113 scoped_ptr<base::DictionaryValue> onc_part( | 118 scoped_ptr<base::DictionaryValue> onc_part( |
| 114 onc::TranslateShillServiceToONCPart(entry_properties, | 119 onc::TranslateShillServiceToONCPart( |
| 115 &onc::kNetworkWithStateSignature)); | 120 entry_properties, onc_source, &onc::kNetworkWithStateSignature)); |
|
pneubeck (no reviews)
2014/09/10 20:22:38
you could always pass ONC_SOURCE_UNKNOWN as 'Sourc
stevenjb
2014/09/10 22:42:01
Done.
| |
| 116 | 121 |
| 117 std::string old_guid; | 122 std::string old_guid; |
| 118 if (!onc_part->GetStringWithoutPathExpansion(::onc::network_config::kGUID, | 123 if (!onc_part->GetStringWithoutPathExpansion(::onc::network_config::kGUID, |
| 119 &old_guid)) { | 124 &old_guid)) { |
| 120 VLOG(1) << "Entry " << entry << " of profile " << profile_.ToDebugString() | 125 VLOG(1) << "Entry " << entry << " of profile " << profile_.ToDebugString() |
| 121 << " doesn't contain a GUID."; | 126 << " doesn't contain a GUID."; |
| 122 // This might be an entry of an older ChromeOS version. Assume it to be | 127 // This might be an entry of an older ChromeOS version. Assume it to be |
| 123 // unmanaged. | 128 // unmanaged. |
| 124 } | 129 } |
| 125 | 130 |
| 126 scoped_ptr<NetworkUIData> ui_data = | |
| 127 shill_property_util::GetUIDataFromProperties(entry_properties); | |
| 128 if (!ui_data) { | 131 if (!ui_data) { |
| 129 VLOG(1) << "Entry " << entry << " of profile " << profile_.ToDebugString() | 132 VLOG(1) << "Entry " << entry << " of profile " << profile_.ToDebugString() |
| 130 << " contains no or no valid UIData."; | 133 << " contains no or no valid UIData."; |
| 131 // This might be an entry of an older ChromeOS version. Assume it to be | 134 // This might be an entry of an older ChromeOS version. Assume it to be |
| 132 // unmanaged. It's an inconsistency if there is a GUID but no UIData, thus | 135 // unmanaged. It's an inconsistency if there is a GUID but no UIData, thus |
| 133 // clear the GUID just in case. | 136 // clear the GUID just in case. |
| 134 old_guid.clear(); | 137 old_guid.clear(); |
| 135 } | 138 } |
| 136 | 139 |
| 137 bool was_managed = !old_guid.empty() && ui_data && | 140 bool was_managed = !old_guid.empty() && ui_data && |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 *it, | 318 *it, |
| 316 &global_network_config_, | 319 &global_network_config_, |
| 317 network_policy, | 320 network_policy, |
| 318 NULL /* no user settings */); | 321 NULL /* no user settings */); |
| 319 WriteNewShillConfiguration( | 322 WriteNewShillConfiguration( |
| 320 *shill_dictionary, *network_policy, false /* write now */); | 323 *shill_dictionary, *network_policy, false /* write now */); |
| 321 } | 324 } |
| 322 } | 325 } |
| 323 | 326 |
| 324 } // namespace chromeos | 327 } // namespace chromeos |
| OLD | NEW |