Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: chrome/browser/chromeos/cros/network_parser.cc

Issue 9960077: Modify the base::JSONReader interface to take a set of options rather than a boolean flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698