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/shill_property_util.h" | 5 #include "chromeos/network/shill_property_util.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 const base::Value* ui_data_value = NULL; | 208 const base::Value* ui_data_value = NULL; |
209 shill_dictionary.GetWithoutPathExpansion(shill::kUIDataProperty, | 209 shill_dictionary.GetWithoutPathExpansion(shill::kUIDataProperty, |
210 &ui_data_value); | 210 &ui_data_value); |
211 if (!ui_data_value) { | 211 if (!ui_data_value) { |
212 VLOG(2) << "Dictionary has no UIData entry."; | 212 VLOG(2) << "Dictionary has no UIData entry."; |
213 return scoped_ptr<NetworkUIData>(); | 213 return scoped_ptr<NetworkUIData>(); |
214 } | 214 } |
215 scoped_ptr<NetworkUIData> ui_data = GetUIDataFromValue(*ui_data_value); | 215 scoped_ptr<NetworkUIData> ui_data = GetUIDataFromValue(*ui_data_value); |
216 if (!ui_data) | 216 if (!ui_data) |
217 LOG(ERROR) << "UIData is not a valid JSON dictionary."; | 217 LOG(ERROR) << "UIData is not a valid JSON dictionary."; |
218 return ui_data.Pass(); | 218 return ui_data; |
219 } | 219 } |
220 | 220 |
221 void SetUIData(const NetworkUIData& ui_data, | 221 void SetUIData(const NetworkUIData& ui_data, |
222 base::DictionaryValue* shill_dictionary) { | 222 base::DictionaryValue* shill_dictionary) { |
223 base::DictionaryValue ui_data_dict; | 223 base::DictionaryValue ui_data_dict; |
224 ui_data.FillDictionary(&ui_data_dict); | 224 ui_data.FillDictionary(&ui_data_dict); |
225 std::string ui_data_blob; | 225 std::string ui_data_blob; |
226 base::JSONWriter::Write(ui_data_dict, &ui_data_blob); | 226 base::JSONWriter::Write(ui_data_dict, &ui_data_blob); |
227 shill_dictionary->SetStringWithoutPathExpansion(shill::kUIDataProperty, | 227 shill_dictionary->SetStringWithoutPathExpansion(shill::kUIDataProperty, |
228 ui_data_blob); | 228 ui_data_blob); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 LOG(WARNING) | 374 LOG(WARNING) |
375 << "Provider name and country not defined, using code instead: " | 375 << "Provider name and country not defined, using code instead: " |
376 << *home_provider_id; | 376 << *home_provider_id; |
377 } | 377 } |
378 return true; | 378 return true; |
379 } | 379 } |
380 | 380 |
381 } // namespace shill_property_util | 381 } // namespace shill_property_util |
382 | 382 |
383 } // namespace chromeos | 383 } // namespace chromeos |
OLD | NEW |