| 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 <map> | 7 #include <map> |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 int index = parent->GetIndexOf(dst); | 544 int index = parent->GetIndexOf(dst); |
| 545 if (index > -1) | 545 if (index > -1) |
| 546 model->Remove(parent, index); | 546 model->Remove(parent, index); |
| 547 } | 547 } |
| 548 | 548 |
| 549 // A map to keep track of some reordering work we defer until later. | 549 // A map to keep track of some reordering work we defer until later. |
| 550 std::multimap<int, const BookmarkNode*> to_reposition; | 550 std::multimap<int, const BookmarkNode*> to_reposition; |
| 551 | 551 |
| 552 syncer::ReadNode synced_bookmarks(trans); | 552 syncer::ReadNode synced_bookmarks(trans); |
| 553 int64 synced_bookmarks_id = syncer::kInvalidId; | 553 int64 synced_bookmarks_id = syncer::kInvalidId; |
| 554 if (synced_bookmarks.InitByTagLookup(kMobileBookmarksTag) == | 554 if (synced_bookmarks.InitByTagLookupForBookmarks(kMobileBookmarksTag) == |
| 555 syncer::BaseNode::INIT_OK) { | 555 syncer::BaseNode::INIT_OK) { |
| 556 synced_bookmarks_id = synced_bookmarks.GetId(); | 556 synced_bookmarks_id = synced_bookmarks.GetId(); |
| 557 } | 557 } |
| 558 | 558 |
| 559 // Continue iterating where the previous loop left off. | 559 // Continue iterating where the previous loop left off. |
| 560 for ( ; it != changes.Get().end(); ++it) { | 560 for ( ; it != changes.Get().end(); ++it) { |
| 561 const BookmarkNode* dst = | 561 const BookmarkNode* dst = |
| 562 model_associator_->GetChromeNodeFromSyncId(it->id); | 562 model_associator_->GetChromeNodeFromSyncId(it->id); |
| 563 | 563 |
| 564 // Ignore changes to the permanent top-level nodes. We only care about | 564 // Ignore changes to the permanent top-level nodes. We only care about |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 sync_pb::BookmarkSpecifics updated_specifics( | 836 sync_pb::BookmarkSpecifics updated_specifics( |
| 837 sync_node->GetBookmarkSpecifics()); | 837 sync_node->GetBookmarkSpecifics()); |
| 838 updated_specifics.set_favicon(favicon_bytes->front(), | 838 updated_specifics.set_favicon(favicon_bytes->front(), |
| 839 favicon_bytes->size()); | 839 favicon_bytes->size()); |
| 840 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); | 840 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); |
| 841 sync_node->SetBookmarkSpecifics(updated_specifics); | 841 sync_node->SetBookmarkSpecifics(updated_specifics); |
| 842 } | 842 } |
| 843 } | 843 } |
| 844 | 844 |
| 845 } // namespace browser_sync | 845 } // namespace browser_sync |
| OLD | NEW |