| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifdef CHROME_PERSONALIZATION | 5 #ifdef CHROME_PERSONALIZATION |
| 6 | 6 |
| 7 #include "chrome/browser/sync/glue/change_processor.h" | 7 #include "chrome/browser/sync/glue/change_processor.h" |
| 8 | 8 |
| 9 #include "app/gfx/codec/png_codec.h" | 9 #include "app/gfx/codec/png_codec.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 // TODO(ncarter): Determine if such changes should be legal or not. | 450 // TODO(ncarter): Determine if such changes should be legal or not. |
| 451 DCHECK_EQ(src->GetIsFolder(), dst->is_folder()); | 451 DCHECK_EQ(src->GetIsFolder(), dst->is_folder()); |
| 452 | 452 |
| 453 // Handle reparenting and/or repositioning. | 453 // Handle reparenting and/or repositioning. |
| 454 model->Move(dst, parent, index); | 454 model->Move(dst, parent, index); |
| 455 | 455 |
| 456 // Handle title update and URL changes due to possible conflict resolution | 456 // Handle title update and URL changes due to possible conflict resolution |
| 457 // that can happen if both a local user change and server change occur | 457 // that can happen if both a local user change and server change occur |
| 458 // within a sufficiently small time interval. | 458 // within a sufficiently small time interval. |
| 459 const BookmarkNode* old_dst = dst; | 459 const BookmarkNode* old_dst = dst; |
| 460 dst = bookmark_utils::ApplyEditsWithNoGroupChange(model, parent, dst, | 460 dst = bookmark_utils::ApplyEditsWithNoGroupChange(model, parent, |
| 461 BookmarkEditor::EditDetails(dst), |
| 461 UTF16ToWide(src->GetTitle()), | 462 UTF16ToWide(src->GetTitle()), |
| 462 src->GetIsFolder() ? GURL() : GURL(src->GetURL()), | 463 src->GetIsFolder() ? GURL() : GURL(src->GetURL()), |
| 463 NULL); // NULL because we don't need a BookmarkEditor::Handler. | 464 NULL); // NULL because we don't need a BookmarkEditor::Handler. |
| 464 if (dst != old_dst) { // dst was replaced with a new node with new URL. | 465 if (dst != old_dst) { // dst was replaced with a new node with new URL. |
| 465 model_associator_->DisassociateIds(src->GetId()); | 466 model_associator_->DisassociateIds(src->GetId()); |
| 466 model_associator_->AssociateIds(dst->id(), src->GetId()); | 467 model_associator_->AssociateIds(dst->id(), src->GetId()); |
| 467 } | 468 } |
| 468 SetBookmarkFavicon(src, dst, model->profile()); | 469 SetBookmarkFavicon(src, dst, model->profile()); |
| 469 } | 470 } |
| 470 | 471 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 sync_api::WriteNode* sync_node) { | 536 sync_api::WriteNode* sync_node) { |
| 536 std::vector<unsigned char> favicon_bytes; | 537 std::vector<unsigned char> favicon_bytes; |
| 537 EncodeFavicon(bookmark_node, model, &favicon_bytes); | 538 EncodeFavicon(bookmark_node, model, &favicon_bytes); |
| 538 if (!favicon_bytes.empty()) | 539 if (!favicon_bytes.empty()) |
| 539 sync_node->SetFaviconBytes(&favicon_bytes[0], favicon_bytes.size()); | 540 sync_node->SetFaviconBytes(&favicon_bytes[0], favicon_bytes.size()); |
| 540 } | 541 } |
| 541 | 542 |
| 542 } // namespace browser_sync | 543 } // namespace browser_sync |
| 543 | 544 |
| 544 #endif // CHROME_PERSONALIZATION | 545 #endif // CHROME_PERSONALIZATION |
| OLD | NEW |