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_parser.h" | 5 #include "chrome/browser/chromeos/cros/network_parser.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" // for debug output only. | 8 #include "base/json/json_writer.h" // for debug output only. |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 return false; | 210 return false; |
211 network->set_proxy_config(proxy_config); | 211 network->set_proxy_config(proxy_config); |
212 return true; | 212 return true; |
213 } | 213 } |
214 case PROPERTY_INDEX_UI_DATA: { | 214 case PROPERTY_INDEX_UI_DATA: { |
215 network->set_ui_data(NetworkUIData()); | 215 network->set_ui_data(NetworkUIData()); |
216 std::string ui_data_json; | 216 std::string ui_data_json; |
217 if (!value.GetAsString(&ui_data_json)) | 217 if (!value.GetAsString(&ui_data_json)) |
218 return false; | 218 return false; |
219 scoped_ptr<base::Value> ui_data_value( | 219 scoped_ptr<base::Value> ui_data_value( |
220 base::JSONReader::Read(ui_data_json, false)); | 220 base::JSONReader::Read(ui_data_json)); |
221 base::DictionaryValue* ui_data_dict = NULL; | 221 base::DictionaryValue* ui_data_dict = NULL; |
222 if (!ui_data_value.get() || | 222 if (!ui_data_value.get() || |
223 !ui_data_value->GetAsDictionary(&ui_data_dict)) | 223 !ui_data_value->GetAsDictionary(&ui_data_dict)) |
224 return false; | 224 return false; |
225 network->set_ui_data(NetworkUIData(*ui_data_dict)); | 225 network->set_ui_data(NetworkUIData(*ui_data_dict)); |
226 return true; | 226 return true; |
227 } | 227 } |
228 default: | 228 default: |
229 break; | 229 break; |
230 } | 230 } |
231 return false; | 231 return false; |
232 } | 232 } |
233 | 233 |
234 } // namespace chromeos | 234 } // namespace chromeos |
OLD | NEW |