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

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

Issue 5159001: Rest of the autofill work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Autofill code after fixing the lint errors. Created 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/string16.h" 10 #include "base/string16.h"
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 // Create a bookmark node corresponding to |src| if one is not already 439 // Create a bookmark node corresponding to |src| if one is not already
440 // associated with |src|. 440 // associated with |src|.
441 const BookmarkNode* BookmarkChangeProcessor::CreateOrUpdateBookmarkNode( 441 const BookmarkNode* BookmarkChangeProcessor::CreateOrUpdateBookmarkNode(
442 sync_api::BaseNode* src, 442 sync_api::BaseNode* src,
443 BookmarkModel* model) { 443 BookmarkModel* model) {
444 const BookmarkNode* parent = 444 const BookmarkNode* parent =
445 model_associator_->GetChromeNodeFromSyncId(src->GetParentId()); 445 model_associator_->GetChromeNodeFromSyncId(src->GetParentId());
446 if (!parent) { 446 if (!parent) {
447 DLOG(WARNING) << "Could not find parent of node being added/updated." 447 DLOG(WARNING) << "Could not find parent of node being added/updated."
448 << " Node title: " << src->GetTitle() 448 << " Node title: " << UTF16ToUTF8(src->GetTitle())
lipalani 2010/12/11 00:12:36 Pretty weird. In the repo it is compiling with out
449 << ", parent id = " << src->GetParentId(); 449 << ", parent id = " << src->GetParentId();
450 return NULL; 450 return NULL;
451 } 451 }
452 int index = CalculateBookmarkModelInsertionIndex(parent, src); 452 int index = CalculateBookmarkModelInsertionIndex(parent, src);
453 const BookmarkNode* dst = model_associator_->GetChromeNodeFromSyncId( 453 const BookmarkNode* dst = model_associator_->GetChromeNodeFromSyncId(
454 src->GetId()); 454 src->GetId());
455 if (!dst) { 455 if (!dst) {
456 dst = CreateBookmarkNode(src, parent, model, index); 456 dst = CreateBookmarkNode(src, parent, model, index);
457 model_associator_->Associate(dst, src->GetId()); 457 model_associator_->Associate(dst, src->GetId());
458 } else { 458 } else {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 const BookmarkNode* bookmark_node, 542 const BookmarkNode* bookmark_node,
543 BookmarkModel* model, 543 BookmarkModel* model,
544 sync_api::WriteNode* sync_node) { 544 sync_api::WriteNode* sync_node) {
545 std::vector<unsigned char> favicon_bytes; 545 std::vector<unsigned char> favicon_bytes;
546 EncodeFavicon(bookmark_node, model, &favicon_bytes); 546 EncodeFavicon(bookmark_node, model, &favicon_bytes);
547 if (!favicon_bytes.empty()) 547 if (!favicon_bytes.empty())
548 sync_node->SetFaviconBytes(favicon_bytes); 548 sync_node->SetFaviconBytes(favicon_bytes);
549 } 549 }
550 550
551 } // namespace browser_sync 551 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698