Chromium Code Reviews| Index: chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc |
| diff --git a/chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc b/chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc |
| index ec6f436da3c09fb580abc5c9c1693dc93cf671a2..768fd92d1dcd6859454a4318823e6b4db538ece8 100644 |
| --- a/chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc |
| +++ b/chrome/browser/extensions/api/bookmarks/bookmark_api_helpers.cc |
| @@ -134,5 +134,26 @@ bool RemoveNode(ChromeBookmarkClient* client, |
| return true; |
| } |
| +void GetMetaInfo(const BookmarkNode* node, |
|
not at google - send to devlin
2014/06/18 17:05:01
better to pass in a const ref here to imply non-nu
yefimt
2014/06/18 17:29:28
Done.
|
| + base::DictionaryValue* id_to_meta_info_map) { |
| + if (node->IsVisible()) { |
|
not at google - send to devlin
2014/06/18 17:05:01
nit: can you early-return here? rather that than t
yefimt
2014/06/18 17:29:28
Done.
|
| + const BookmarkNode::MetaInfoMap* meta_info = node->GetMetaInfoMap(); |
| + base::DictionaryValue* value = new base::DictionaryValue(); |
| + if (meta_info) { |
| + BookmarkNode::MetaInfoMap::const_iterator itr; |
| + for (itr = meta_info->begin(); itr != meta_info->end(); itr++) { |
|
not at google - send to devlin
2014/06/18 17:05:01
++itr not itr++
also I personally don't like decl
yefimt
2014/06/18 17:29:28
Done
|
| + value->SetStringWithoutPathExpansion(itr->first, itr->second); |
| + } |
| + } |
| + id_to_meta_info_map->Set(base::Int64ToString(node->id()), value); |
| + |
| + if (node->is_folder()) { |
| + for (int i = 0; i < node->child_count(); ++i) { |
| + GetMetaInfo(node->GetChild(i), id_to_meta_info_map); |
| + } |
| + } |
| + } |
| +} |
| + |
| } // namespace bookmark_api_helpers |
| } // namespace extensions |