#include "chrome/browser/undo/bookmark_undo_service.h"
#include "chrome/browser/undo/bookmark_undo_service_factory.h"
#include "chrome/browser/undo/bookmark_undo_utils.h"
+#include "components/bookmarks/browser/bookmark_client.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "content/public/browser/browser_thread.h"
}
void BookmarkChangeProcessor::CreateOrUpdateSyncNode(const BookmarkNode* node) {
+ if (!CanSyncNode(node)) {
+ NOTREACHED();
+ return;
+ }
+
const BookmarkNode* parent = node->parent();
int index = node->parent()->GetIndexOf(node);
const BookmarkNode* parent,
int index) {
DCHECK(share_handle());
- CreateOrUpdateSyncNode(parent->GetChild(index));
+ const BookmarkNode* node = parent->GetChild(index);
+ if (CanSyncNode(node))
+ CreateOrUpdateSyncNode(node);
}
// static
int index,
const BookmarkNode* node,
const std::set<GURL>& removed_urls) {
- RemoveSyncNodeHierarchy(node);
+ if (CanSyncNode(node))
+ RemoveSyncNodeHierarchy(node);
}
void BookmarkChangeProcessor::BookmarkAllUserNodesRemoved(
void BookmarkChangeProcessor::BookmarkNodeChanged(BookmarkModel* model,
const BookmarkNode* node) {
+ if (!CanSyncNode(node))
+ return;
// We shouldn't see changes to the top-level nodes.
if (model->is_permanent_node(node)) {
NOTREACHED() << "Saw update to permanent node!";
const BookmarkNode* old_parent, int old_index,
const BookmarkNode* new_parent, int new_index) {
const BookmarkNode* child = new_parent->GetChild(new_index);
+
+ if (!CanSyncNode(child))
+ return;
+
// We shouldn't see changes to the top-level nodes.
if (model->is_permanent_node(child)) {
NOTREACHED() << "Saw update to permanent node!";
void BookmarkChangeProcessor::BookmarkNodeChildrenReordered(
BookmarkModel* model, const BookmarkNode* node) {
+ if (!CanSyncNode(node))
+ return;
int64 new_version = syncer::syncable::kInvalidTransactionVersion;
std::vector<const BookmarkNode*> children;
{
model->RemoveObserver(this);
// Changes made to the bookmark model due to sync should not be undoable.
-#if !defined(OS_ANDROID)
ScopedSuspendBookmarkUndo suspend_undo(profile_);
-#endif
// Notify UI intensive observers of BookmarkModel that we are about to make
// potentially significant changes to it, so the updates may be batched. For
}
}
+bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) {
+ return bookmark_model_->client()->CanSyncNode(node);
+}
+
} // namespace browser_sync