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

Side by Side Diff: chrome/browser/android/bookmarks/partner_bookmarks_shim.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Created 3 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
« no previous file with comments | « cc/test/layer_tree_json_parser.cc ('k') | chrome/browser/android/vr_shell/gltf_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/android/bookmarks/partner_bookmarks_shim.h" 5 #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 return; 246 return;
247 247
248 const base::ListValue* list = 248 const base::ListValue* list =
249 prefs_->GetList(prefs::kPartnerBookmarkMappings); 249 prefs_->GetList(prefs::kPartnerBookmarkMappings);
250 if (!list) 250 if (!list)
251 return; 251 return;
252 252
253 for (base::ListValue::const_iterator it = list->begin(); 253 for (base::ListValue::const_iterator it = list->begin();
254 it != list->end(); ++it) { 254 it != list->end(); ++it) {
255 const base::DictionaryValue* dict = NULL; 255 const base::DictionaryValue* dict = NULL;
256 if (!it->GetAsDictionary(&dict)) { 256 if (!*it || !(*it)->GetAsDictionary(&dict)) {
257 NOTREACHED(); 257 NOTREACHED();
258 continue; 258 continue;
259 } 259 }
260 260
261 std::string url; 261 std::string url;
262 base::string16 provider_title; 262 base::string16 provider_title;
263 base::string16 mapped_title; 263 base::string16 mapped_title;
264 if (!dict->GetString(kMappingUrl, &url) || 264 if (!dict->GetString(kMappingUrl, &url) ||
265 !dict->GetString(kMappingProviderTitle, &provider_title) || 265 !dict->GetString(kMappingProviderTitle, &provider_title) ||
266 !dict->GetString(kMappingTitle, &mapped_title)) { 266 !dict->GetString(kMappingTitle, &mapped_title)) {
(...skipping 16 matching lines...) Expand all
283 i != node_rename_remove_map_.end(); 283 i != node_rename_remove_map_.end();
284 ++i) { 284 ++i) {
285 base::DictionaryValue* dict = new base::DictionaryValue(); 285 base::DictionaryValue* dict = new base::DictionaryValue();
286 dict->SetString(kMappingUrl, i->first.url().spec()); 286 dict->SetString(kMappingUrl, i->first.url().spec());
287 dict->SetString(kMappingProviderTitle, i->first.provider_title()); 287 dict->SetString(kMappingProviderTitle, i->first.provider_title());
288 dict->SetString(kMappingTitle, i->second); 288 dict->SetString(kMappingTitle, i->second);
289 list.Append(dict); 289 list.Append(dict);
290 } 290 }
291 prefs_->Set(prefs::kPartnerBookmarkMappings, list); 291 prefs_->Set(prefs::kPartnerBookmarkMappings, list);
292 } 292 }
OLDNEW
« no previous file with comments | « cc/test/layer_tree_json_parser.cc ('k') | chrome/browser/android/vr_shell/gltf_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698