OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <map> | 7 #include <map> |
8 #include <stack> | 8 #include <stack> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 // before the move. Since deletions in the bookmark model propagate from | 523 // before the move. Since deletions in the bookmark model propagate from |
524 // parent to child, we must move them to a temporary location. | 524 // parent to child, we must move them to a temporary location. |
525 BookmarkModel* model = bookmark_model_; | 525 BookmarkModel* model = bookmark_model_; |
526 | 526 |
527 // We are going to make changes to the bookmarks model, but don't want to end | 527 // We are going to make changes to the bookmarks model, but don't want to end |
528 // up in a feedback loop, so remove ourselves as an observer while applying | 528 // up in a feedback loop, so remove ourselves as an observer while applying |
529 // changes. | 529 // changes. |
530 model->RemoveObserver(this); | 530 model->RemoveObserver(this); |
531 | 531 |
532 // Changes made to the bookmark model due to sync should not be undoable. | 532 // Changes made to the bookmark model due to sync should not be undoable. |
533 #if !defined(OS_ANDROID) | |
534 ScopedSuspendBookmarkUndo suspend_undo(profile_); | 533 ScopedSuspendBookmarkUndo suspend_undo(profile_); |
535 #endif | |
536 | 534 |
537 // Notify UI intensive observers of BookmarkModel that we are about to make | 535 // Notify UI intensive observers of BookmarkModel that we are about to make |
538 // potentially significant changes to it, so the updates may be batched. For | 536 // potentially significant changes to it, so the updates may be batched. For |
539 // example, on Mac, the bookmarks bar displays animations when bookmark items | 537 // example, on Mac, the bookmarks bar displays animations when bookmark items |
540 // are added or deleted. | 538 // are added or deleted. |
541 model->BeginExtensiveChanges(); | 539 model->BeginExtensiveChanges(); |
542 | 540 |
543 // A parent to hold nodes temporarily orphaned by parent deletion. It is | 541 // A parent to hold nodes temporarily orphaned by parent deletion. It is |
544 // created only if it is needed. | 542 // created only if it is needed. |
545 const BookmarkNode* foster_parent = NULL; | 543 const BookmarkNode* foster_parent = NULL; |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); | 887 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); |
890 sync_node->SetBookmarkSpecifics(updated_specifics); | 888 sync_node->SetBookmarkSpecifics(updated_specifics); |
891 } | 889 } |
892 } | 890 } |
893 | 891 |
894 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { | 892 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { |
895 return bookmark_model_->client()->CanSyncNode(node); | 893 return bookmark_model_->client()->CanSyncNode(node); |
896 } | 894 } |
897 | 895 |
898 } // namespace browser_sync | 896 } // namespace browser_sync |
OLD | NEW |