OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/sync_bookmarks/bookmark_change_processor.h" | 5 #include "components/sync_bookmarks/bookmark_change_processor.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <stack> | 10 #include <stack> |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 // unique. | 864 // unique. |
865 if (icon_url.is_empty()) | 865 if (icon_url.is_empty()) |
866 icon_url = bookmark_node->url(); | 866 icon_url = bookmark_node->url(); |
867 | 867 |
868 ApplyBookmarkFavicon(bookmark_node, sync_client, icon_url, icon_bytes); | 868 ApplyBookmarkFavicon(bookmark_node, sync_client, icon_url, icon_bytes); |
869 | 869 |
870 return true; | 870 return true; |
871 } | 871 } |
872 | 872 |
873 // static | 873 // static |
874 scoped_ptr<BookmarkNode::MetaInfoMap> | 874 std::unique_ptr<BookmarkNode::MetaInfoMap> |
875 BookmarkChangeProcessor::GetBookmarkMetaInfo( | 875 BookmarkChangeProcessor::GetBookmarkMetaInfo( |
876 const syncer::BaseNode* sync_node) { | 876 const syncer::BaseNode* sync_node) { |
877 const sync_pb::BookmarkSpecifics& specifics = | 877 const sync_pb::BookmarkSpecifics& specifics = |
878 sync_node->GetBookmarkSpecifics(); | 878 sync_node->GetBookmarkSpecifics(); |
879 scoped_ptr<BookmarkNode::MetaInfoMap> meta_info_map( | 879 std::unique_ptr<BookmarkNode::MetaInfoMap> meta_info_map( |
880 new BookmarkNode::MetaInfoMap); | 880 new BookmarkNode::MetaInfoMap); |
881 for (int i = 0; i < specifics.meta_info_size(); ++i) { | 881 for (int i = 0; i < specifics.meta_info_size(); ++i) { |
882 (*meta_info_map)[specifics.meta_info(i).key()] = | 882 (*meta_info_map)[specifics.meta_info(i).key()] = |
883 specifics.meta_info(i).value(); | 883 specifics.meta_info(i).value(); |
884 } | 884 } |
885 // Verifies that all entries had unique keys. | 885 // Verifies that all entries had unique keys. |
886 DCHECK_EQ(static_cast<size_t>(specifics.meta_info_size()), | 886 DCHECK_EQ(static_cast<size_t>(specifics.meta_info_size()), |
887 meta_info_map->size()); | 887 meta_info_map->size()); |
888 return meta_info_map; | 888 return meta_info_map; |
889 } | 889 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); | 971 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); |
972 sync_node->SetBookmarkSpecifics(updated_specifics); | 972 sync_node->SetBookmarkSpecifics(updated_specifics); |
973 } | 973 } |
974 } | 974 } |
975 | 975 |
976 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { | 976 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { |
977 return bookmark_model_->client()->CanSyncNode(node); | 977 return bookmark_model_->client()->CanSyncNode(node); |
978 } | 978 } |
979 | 979 |
980 } // namespace browser_sync | 980 } // namespace browser_sync |
OLD | NEW |