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/network_ui_data.h" | 5 #include "chromeos/network/network_ui_data.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chromeos/network/onc/onc_signature.h" | 9 #include "chromeos/network/onc/onc_signature.h" |
10 | 10 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 const onc::OncFieldSignature* field_signature = | 211 const onc::OncFieldSignature* field_signature = |
212 GetFieldSignature(signature, it.key()); | 212 GetFieldSignature(signature, it.key()); |
213 | 213 |
214 TranslateONCHierarchy(*field_signature->value_signature, *inner_object, | 214 TranslateONCHierarchy(*field_signature->value_signature, *inner_object, |
215 ui_data); | 215 ui_data); |
216 } | 216 } |
217 } | 217 } |
218 | 218 |
219 } // namespace | 219 } // namespace |
220 | 220 |
221 scoped_ptr<NetworkUIData> CreateUIDataFromONC( | 221 // static |
| 222 scoped_ptr<NetworkUIData> NetworkUIData::CreateFromONC( |
222 onc::ONCSource onc_source, | 223 onc::ONCSource onc_source, |
223 const base::DictionaryValue& onc_network) { | 224 const base::DictionaryValue& onc_network) { |
224 scoped_ptr<NetworkUIData> ui_data(new NetworkUIData()); | 225 scoped_ptr<NetworkUIData> ui_data(new NetworkUIData()); |
225 TranslateONCHierarchy(onc::kNetworkConfigurationSignature, onc_network, | 226 TranslateONCHierarchy(onc::kNetworkConfigurationSignature, onc_network, |
226 ui_data.get()); | 227 ui_data.get()); |
227 | 228 |
228 ui_data->set_onc_source(onc_source); | 229 ui_data->set_onc_source(onc_source); |
229 | 230 |
230 return ui_data.Pass(); | 231 return ui_data.Pass(); |
231 } | 232 } |
232 | 233 |
233 } // namespace chromeos | 234 } // namespace chromeos |
OLD | NEW |