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

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

Issue 1059523005: Remove dependency on //chrome from bookmark_undo_utils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tests
Patch Set: Created 5 years, 8 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 | chrome/browser/sync/glue/bookmark_model_associator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 // before the move. Since deletions in the bookmark model propagate from 542 // before the move. Since deletions in the bookmark model propagate from
543 // parent to child, we must move them to a temporary location. 543 // parent to child, we must move them to a temporary location.
544 BookmarkModel* model = bookmark_model_; 544 BookmarkModel* model = bookmark_model_;
545 545
546 // We are going to make changes to the bookmarks model, but don't want to end 546 // We are going to make changes to the bookmarks model, but don't want to end
547 // up in a feedback loop, so remove ourselves as an observer while applying 547 // up in a feedback loop, so remove ourselves as an observer while applying
548 // changes. 548 // changes.
549 model->RemoveObserver(this); 549 model->RemoveObserver(this);
550 550
551 // Changes made to the bookmark model due to sync should not be undoable. 551 // Changes made to the bookmark model due to sync should not be undoable.
552 ScopedSuspendBookmarkUndo suspend_undo(profile_); 552 ScopedSuspendBookmarkUndo suspend_undo(
553 BookmarkUndoServiceFactory::GetForProfileIfExists(profile_));
553 554
554 // Notify UI intensive observers of BookmarkModel that we are about to make 555 // Notify UI intensive observers of BookmarkModel that we are about to make
555 // potentially significant changes to it, so the updates may be batched. For 556 // potentially significant changes to it, so the updates may be batched. For
556 // example, on Mac, the bookmarks bar displays animations when bookmark items 557 // example, on Mac, the bookmarks bar displays animations when bookmark items
557 // are added or deleted. 558 // are added or deleted.
558 model->BeginExtensiveChanges(); 559 model->BeginExtensiveChanges();
559 560
560 // A parent to hold nodes temporarily orphaned by parent deletion. It is 561 // A parent to hold nodes temporarily orphaned by parent deletion. It is
561 // created only if it is needed. 562 // created only if it is needed.
562 const BookmarkNode* foster_parent = NULL; 563 const BookmarkNode* foster_parent = NULL;
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); 938 updated_specifics.set_icon_url(bookmark_node->icon_url().spec());
938 sync_node->SetBookmarkSpecifics(updated_specifics); 939 sync_node->SetBookmarkSpecifics(updated_specifics);
939 } 940 }
940 } 941 }
941 942
942 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { 943 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) {
943 return bookmark_model_->client()->CanSyncNode(node); 944 return bookmark_model_->client()->CanSyncNode(node);
944 } 945 }
945 946
946 } // namespace browser_sync 947 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/glue/bookmark_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698