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_model_associator.h" | 5 #include "chrome/browser/sync/glue/bookmark_model_associator.h" |
6 | 6 |
7 #include <stack> | 7 #include <stack> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 return false; | 413 return false; |
414 *sync_id = sync_node.GetId(); | 414 *sync_id = sync_node.GetId(); |
415 return true; | 415 return true; |
416 } | 416 } |
417 | 417 |
418 syncer::SyncError BookmarkModelAssociator::AssociateModels( | 418 syncer::SyncError BookmarkModelAssociator::AssociateModels( |
419 syncer::SyncMergeResult* local_merge_result, | 419 syncer::SyncMergeResult* local_merge_result, |
420 syncer::SyncMergeResult* syncer_merge_result) { | 420 syncer::SyncMergeResult* syncer_merge_result) { |
421 // Since any changes to the bookmark model made here are not user initiated, | 421 // Since any changes to the bookmark model made here are not user initiated, |
422 // these change should not be undoable and so suspend the undo tracking. | 422 // these change should not be undoable and so suspend the undo tracking. |
423 ScopedSuspendBookmarkUndo suspend_undo(profile_); | 423 ScopedSuspendBookmarkUndo suspend_undo( |
| 424 BookmarkUndoServiceFactory::GetForProfileIfExists(profile_)); |
424 | 425 |
425 syncer::SyncError error = CheckModelSyncState(local_merge_result, | 426 syncer::SyncError error = CheckModelSyncState(local_merge_result, |
426 syncer_merge_result); | 427 syncer_merge_result); |
427 if (error.IsSet()) | 428 if (error.IsSet()) |
428 return error; | 429 return error; |
429 | 430 |
430 scoped_ptr<ScopedAssociationUpdater> association_updater( | 431 scoped_ptr<ScopedAssociationUpdater> association_updater( |
431 new ScopedAssociationUpdater(bookmark_model_)); | 432 new ScopedAssociationUpdater(bookmark_model_)); |
432 DisassociateModels(); | 433 DisassociateModels(); |
433 | 434 |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 syncer::SyncError::PERSISTENCE_ERROR, | 835 syncer::SyncError::PERSISTENCE_ERROR, |
835 message, | 836 message, |
836 syncer::BOOKMARKS); | 837 syncer::BOOKMARKS); |
837 } | 838 } |
838 } | 839 } |
839 } | 840 } |
840 return syncer::SyncError(); | 841 return syncer::SyncError(); |
841 } | 842 } |
842 | 843 |
843 } // namespace browser_sync | 844 } // namespace browser_sync |
OLD | NEW |