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 "chrome/browser/sync/glue/bookmark_change_processor.h" | 5 #include "chrome/browser/sync/glue/bookmark_change_processor.h" |
6 | 6 |
7 #include <stack> | 7 #include <stack> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 DCHECK(bookmark_model_->IsLoaded()); | 63 DCHECK(bookmark_model_->IsLoaded()); |
64 bookmark_model_->AddObserver(this); | 64 bookmark_model_->AddObserver(this); |
65 } | 65 } |
66 | 66 |
67 void BookmarkChangeProcessor::UpdateSyncNodeProperties( | 67 void BookmarkChangeProcessor::UpdateSyncNodeProperties( |
68 const BookmarkNode* src, | 68 const BookmarkNode* src, |
69 BookmarkModel* model, | 69 BookmarkModel* model, |
70 syncer::WriteNode* dst) { | 70 syncer::WriteNode* dst) { |
71 // Set the properties of the item. | 71 // Set the properties of the item. |
72 dst->SetIsFolder(src->is_folder()); | 72 dst->SetIsFolder(src->is_folder()); |
73 dst->SetTitle(UTF16ToWideHack(src->GetTitle())); | 73 dst->SetTitle(base::UTF16ToWideHack(src->GetTitle())); |
74 sync_pb::BookmarkSpecifics bookmark_specifics(dst->GetBookmarkSpecifics()); | 74 sync_pb::BookmarkSpecifics bookmark_specifics(dst->GetBookmarkSpecifics()); |
75 if (!src->is_folder()) | 75 if (!src->is_folder()) |
76 bookmark_specifics.set_url(src->url().spec()); | 76 bookmark_specifics.set_url(src->url().spec()); |
77 bookmark_specifics.set_creation_time_us(src->date_added().ToInternalValue()); | 77 bookmark_specifics.set_creation_time_us(src->date_added().ToInternalValue()); |
78 dst->SetBookmarkSpecifics(bookmark_specifics); | 78 dst->SetBookmarkSpecifics(bookmark_specifics); |
79 SetSyncNodeFavicon(src, model, dst); | 79 SetSyncNodeFavicon(src, model, dst); |
80 } | 80 } |
81 | 81 |
82 // static | 82 // static |
83 void BookmarkChangeProcessor::EncodeFavicon( | 83 void BookmarkChangeProcessor::EncodeFavicon( |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 sync_pb::BookmarkSpecifics updated_specifics( | 756 sync_pb::BookmarkSpecifics updated_specifics( |
757 sync_node->GetBookmarkSpecifics()); | 757 sync_node->GetBookmarkSpecifics()); |
758 updated_specifics.set_favicon(favicon_bytes->front(), | 758 updated_specifics.set_favicon(favicon_bytes->front(), |
759 favicon_bytes->size()); | 759 favicon_bytes->size()); |
760 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); | 760 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); |
761 sync_node->SetBookmarkSpecifics(updated_specifics); | 761 sync_node->SetBookmarkSpecifics(updated_specifics); |
762 } | 762 } |
763 } | 763 } |
764 | 764 |
765 } // namespace browser_sync | 765 } // namespace browser_sync |
OLD | NEW |