OLD | NEW |
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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } else { | 458 } else { |
459 // URL and is_folder are not expected to change. | 459 // URL and is_folder are not expected to change. |
460 // TODO(ncarter): Determine if such changes should be legal or not. | 460 // TODO(ncarter): Determine if such changes should be legal or not. |
461 DCHECK_EQ(src->GetIsFolder(), dst->is_folder()); | 461 DCHECK_EQ(src->GetIsFolder(), dst->is_folder()); |
462 | 462 |
463 // Handle reparenting and/or repositioning. | 463 // Handle reparenting and/or repositioning. |
464 model->Move(dst, parent, index); | 464 model->Move(dst, parent, index); |
465 | 465 |
466 if (!src->GetIsFolder()) | 466 if (!src->GetIsFolder()) |
467 model->SetURL(dst, src->GetURL()); | 467 model->SetURL(dst, src->GetURL()); |
468 model->SetTitle(dst, src->GetTitle()); | 468 model->SetTitle(dst, WideToUTF16Hack(src->GetTitle())); |
469 | 469 |
470 SetBookmarkFavicon(src, dst, model->profile()); | 470 SetBookmarkFavicon(src, dst, model->profile()); |
471 } | 471 } |
472 | 472 |
473 return dst; | 473 return dst; |
474 } | 474 } |
475 | 475 |
476 // static | 476 // static |
477 // Creates a bookmark node under the given parent node from the given sync | 477 // Creates a bookmark node under the given parent node from the given sync |
478 // node. Returns the newly created node. | 478 // node. Returns the newly created node. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 const BookmarkNode* bookmark_node, | 533 const BookmarkNode* bookmark_node, |
534 BookmarkModel* model, | 534 BookmarkModel* model, |
535 sync_api::WriteNode* sync_node) { | 535 sync_api::WriteNode* sync_node) { |
536 std::vector<unsigned char> favicon_bytes; | 536 std::vector<unsigned char> favicon_bytes; |
537 EncodeFavicon(bookmark_node, model, &favicon_bytes); | 537 EncodeFavicon(bookmark_node, model, &favicon_bytes); |
538 if (!favicon_bytes.empty()) | 538 if (!favicon_bytes.empty()) |
539 sync_node->SetFaviconBytes(favicon_bytes); | 539 sync_node->SetFaviconBytes(favicon_bytes); |
540 } | 540 } |
541 | 541 |
542 } // namespace browser_sync | 542 } // namespace browser_sync |
OLD | NEW |