OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 // Clean up the temporary node. | 445 // Clean up the temporary node. |
446 if (foster_parent) { | 446 if (foster_parent) { |
447 // There should be no nodes left under the foster parent. | 447 // There should be no nodes left under the foster parent. |
448 DCHECK_EQ(foster_parent->child_count(), 0); | 448 DCHECK_EQ(foster_parent->child_count(), 0); |
449 model->Remove(foster_parent->parent(), | 449 model->Remove(foster_parent->parent(), |
450 foster_parent->parent()->GetIndexOf(foster_parent)); | 450 foster_parent->parent()->GetIndexOf(foster_parent)); |
451 foster_parent = NULL; | 451 foster_parent = NULL; |
452 } | 452 } |
453 | 453 |
454 // The visibility of the mobile node may need to change. | 454 // The visibility of the mobile node may need to change. |
455 model_associator_->UpdateMobileNodeVisibility(); | 455 model_associator_->UpdatePermanentNodeVisibility(); |
456 | 456 |
457 // We are now ready to hear about bookmarks changes again. | 457 // We are now ready to hear about bookmarks changes again. |
458 model->AddObserver(this); | 458 model->AddObserver(this); |
459 } | 459 } |
460 | 460 |
461 // Create a bookmark node corresponding to |src| if one is not already | 461 // Create a bookmark node corresponding to |src| if one is not already |
462 // associated with |src|. | 462 // associated with |src|. |
463 const BookmarkNode* BookmarkChangeProcessor::CreateOrUpdateBookmarkNode( | 463 const BookmarkNode* BookmarkChangeProcessor::CreateOrUpdateBookmarkNode( |
464 sync_api::BaseNode* src, | 464 sync_api::BaseNode* src, |
465 BookmarkModel* model) { | 465 BookmarkModel* model) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 const BookmarkNode* bookmark_node, | 567 const BookmarkNode* bookmark_node, |
568 BookmarkModel* model, | 568 BookmarkModel* model, |
569 sync_api::WriteNode* sync_node) { | 569 sync_api::WriteNode* sync_node) { |
570 std::vector<unsigned char> favicon_bytes; | 570 std::vector<unsigned char> favicon_bytes; |
571 EncodeFavicon(bookmark_node, model, &favicon_bytes); | 571 EncodeFavicon(bookmark_node, model, &favicon_bytes); |
572 if (!favicon_bytes.empty()) | 572 if (!favicon_bytes.empty()) |
573 sync_node->SetFaviconBytes(favicon_bytes); | 573 sync_node->SetFaviconBytes(favicon_bytes); |
574 } | 574 } |
575 | 575 |
576 } // namespace browser_sync | 576 } // namespace browser_sync |
OLD | NEW |