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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 const BookmarkNode* bookmark_node, | 961 const BookmarkNode* bookmark_node, |
962 BookmarkModel* model, | 962 BookmarkModel* model, |
963 syncer::WriteNode* sync_node) { | 963 syncer::WriteNode* sync_node) { |
964 scoped_refptr<base::RefCountedMemory> favicon_bytes(nullptr); | 964 scoped_refptr<base::RefCountedMemory> favicon_bytes(nullptr); |
965 EncodeFavicon(bookmark_node, model, &favicon_bytes); | 965 EncodeFavicon(bookmark_node, model, &favicon_bytes); |
966 if (favicon_bytes.get() && favicon_bytes->size()) { | 966 if (favicon_bytes.get() && favicon_bytes->size()) { |
967 sync_pb::BookmarkSpecifics updated_specifics( | 967 sync_pb::BookmarkSpecifics updated_specifics( |
968 sync_node->GetBookmarkSpecifics()); | 968 sync_node->GetBookmarkSpecifics()); |
969 updated_specifics.set_favicon(favicon_bytes->front(), | 969 updated_specifics.set_favicon(favicon_bytes->front(), |
970 favicon_bytes->size()); | 970 favicon_bytes->size()); |
971 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); | 971 updated_specifics.set_icon_url(bookmark_node->icon_url() |
| 972 ? bookmark_node->icon_url()->spec() |
| 973 : std::string()); |
972 sync_node->SetBookmarkSpecifics(updated_specifics); | 974 sync_node->SetBookmarkSpecifics(updated_specifics); |
973 } | 975 } |
974 } | 976 } |
975 | 977 |
976 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { | 978 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { |
977 return bookmark_model_->client()->CanSyncNode(node); | 979 return bookmark_model_->client()->CanSyncNode(node); |
978 } | 980 } |
979 | 981 |
980 } // namespace sync_bookmarks | 982 } // namespace sync_bookmarks |
OLD | NEW |