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

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

Issue 2904013: Don't set the URL on folders. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/string_util.h" 10 #include "base/string_util.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 bookmark_model_->RemoveObserver(this); 43 bookmark_model_->RemoveObserver(this);
44 bookmark_model_ = NULL; 44 bookmark_model_ = NULL;
45 model_associator_ = NULL; 45 model_associator_ = NULL;
46 } 46 }
47 47
48 void BookmarkChangeProcessor::UpdateSyncNodeProperties( 48 void BookmarkChangeProcessor::UpdateSyncNodeProperties(
49 const BookmarkNode* src, BookmarkModel* model, sync_api::WriteNode* dst) { 49 const BookmarkNode* src, BookmarkModel* model, sync_api::WriteNode* dst) {
50 // Set the properties of the item. 50 // Set the properties of the item.
51 dst->SetIsFolder(src->is_folder()); 51 dst->SetIsFolder(src->is_folder());
52 dst->SetTitle(src->GetTitle()); 52 dst->SetTitle(src->GetTitle());
53 dst->SetURL(src->GetURL()); 53 if (!src->is_folder())
54 dst->SetURL(src->GetURL());
54 SetSyncNodeFavicon(src, model, dst); 55 SetSyncNodeFavicon(src, model, dst);
55 } 56 }
56 57
57 // static 58 // static
58 void BookmarkChangeProcessor::EncodeFavicon(const BookmarkNode* src, 59 void BookmarkChangeProcessor::EncodeFavicon(const BookmarkNode* src,
59 BookmarkModel* model, 60 BookmarkModel* model,
60 std::vector<unsigned char>* dst) { 61 std::vector<unsigned char>* dst) {
61 const SkBitmap& favicon = model->GetFavIcon(src); 62 const SkBitmap& favicon = model->GetFavIcon(src);
62 63
63 dst->clear(); 64 dst->clear();
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 const BookmarkNode* bookmark_node, 529 const BookmarkNode* bookmark_node,
529 BookmarkModel* model, 530 BookmarkModel* model,
530 sync_api::WriteNode* sync_node) { 531 sync_api::WriteNode* sync_node) {
531 std::vector<unsigned char> favicon_bytes; 532 std::vector<unsigned char> favicon_bytes;
532 EncodeFavicon(bookmark_node, model, &favicon_bytes); 533 EncodeFavicon(bookmark_node, model, &favicon_bytes);
533 if (!favicon_bytes.empty()) 534 if (!favicon_bytes.empty())
534 sync_node->SetFaviconBytes(favicon_bytes); 535 sync_node->SetFaviconBytes(favicon_bytes);
535 } 536 }
536 537
537 } // namespace browser_sync 538 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698