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

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

Issue 8828006: Makes all permanent nodes share the same node class so that visibility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More tweaks Created 9 years 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698