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

Side by Side Diff: chrome/browser/sync/glue/bookmark_change_processor.cc

Issue 319133007: Documented that the new nodes at the root aren't meant to sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync/glue/bookmark_model_associator.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 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 <map> 7 #include <map>
8 #include <stack> 8 #include <stack>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 syncer::WriteTransaction trans(FROM_HERE, share_handle(), &new_version); 142 syncer::WriteTransaction trans(FROM_HERE, share_handle(), &new_version);
143 143
144 RemoveAllChildNodes(&trans, bookmark_model_->bookmark_bar_node()->id()); 144 RemoveAllChildNodes(&trans, bookmark_model_->bookmark_bar_node()->id());
145 RemoveAllChildNodes(&trans, bookmark_model_->other_node()->id()); 145 RemoveAllChildNodes(&trans, bookmark_model_->other_node()->id());
146 // Remove mobile bookmarks node only if it is present. 146 // Remove mobile bookmarks node only if it is present.
147 const int64 mobile_bookmark_id = bookmark_model_->mobile_node()->id(); 147 const int64 mobile_bookmark_id = bookmark_model_->mobile_node()->id();
148 if (model_associator_->GetSyncIdFromChromeId(mobile_bookmark_id) != 148 if (model_associator_->GetSyncIdFromChromeId(mobile_bookmark_id) !=
149 syncer::kInvalidId) { 149 syncer::kInvalidId) {
150 RemoveAllChildNodes(&trans, bookmark_model_->mobile_node()->id()); 150 RemoveAllChildNodes(&trans, bookmark_model_->mobile_node()->id());
151 } 151 }
152 // Note: the root node may have additional extra nodes. Currently none of
153 // them are meant to sync.
152 } 154 }
153 155
154 // Don't need to update versions of deleted nodes. 156 // Don't need to update versions of deleted nodes.
155 UpdateTransactionVersion(new_version, bookmark_model_, 157 UpdateTransactionVersion(new_version, bookmark_model_,
156 std::vector<const BookmarkNode*>()); 158 std::vector<const BookmarkNode*>());
157 } 159 }
158 160
159 void BookmarkChangeProcessor::RemoveAllChildNodes( 161 void BookmarkChangeProcessor::RemoveAllChildNodes(
160 syncer::WriteTransaction* trans, const int64& topmost_node_id) { 162 syncer::WriteTransaction* trans, const int64& topmost_node_id) {
161 syncer::WriteNode topmost_node(trans); 163 syncer::WriteNode topmost_node(trans);
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 sync_pb::BookmarkSpecifics updated_specifics( 838 sync_pb::BookmarkSpecifics updated_specifics(
837 sync_node->GetBookmarkSpecifics()); 839 sync_node->GetBookmarkSpecifics());
838 updated_specifics.set_favicon(favicon_bytes->front(), 840 updated_specifics.set_favicon(favicon_bytes->front(),
839 favicon_bytes->size()); 841 favicon_bytes->size());
840 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); 842 updated_specifics.set_icon_url(bookmark_node->icon_url().spec());
841 sync_node->SetBookmarkSpecifics(updated_specifics); 843 sync_node->SetBookmarkSpecifics(updated_specifics);
842 } 844 }
843 } 845 }
844 846
845 } // namespace browser_sync 847 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/glue/bookmark_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698