#include "components/sync_bookmarks/local_bookmark_model_merger.h"
#include <list>
#include <optional>
#include <string>
#include <utility>
#include "base/hash/hash.h"
#include "base/strings/utf_string_conversions.h"
#include "base/uuid.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/sync_bookmarks/bookmark_model_view.h"
#include "components/sync_bookmarks/bookmark_specifics_conversions.h"
#include "ui/base/models/tree_node_iterator.h"
#include "url/gurl.h"
namespace sync_bookmarks {
namespace {
struct SiblingSemanticMatchKey { … };
struct SiblingSemanticMatchKeyHash { … };
struct SiblingSemanticMatchKeyEquals { … };
SiblingSemanticMatchKey GetSiblingSemanticMatchKeyForNode(
const bookmarks::BookmarkNode* node) { … }
bool NodesCompatibleForMatchByUuid(const bookmarks::BookmarkNode* node1,
const bookmarks::BookmarkNode* node2) { … }
}
LocalBookmarkModelMerger::LocalBookmarkModelMerger(
const BookmarkModelView* local_model,
BookmarkModelView* account_model)
: … { … }
LocalBookmarkModelMerger::~LocalBookmarkModelMerger() = default;
void LocalBookmarkModelMerger::Merge() { … }
std::unordered_map<base::Uuid,
LocalBookmarkModelMerger::GuidMatch,
base::UuidHash>
LocalBookmarkModelMerger::FindGuidMatches(
const BookmarkModelView* local_model,
const BookmarkModelView* account_model) { … }
void LocalBookmarkModelMerger::MergeSubtree(
const bookmarks::BookmarkNode* local_subtree_root,
const bookmarks::BookmarkNode* account_subtree_root) { … }
void LocalBookmarkModelMerger::UpdateAccountNodeFromMatchingLocalNode(
const bookmarks::BookmarkNode* local_node,
const bookmarks::BookmarkNode* account_node) { … }
const bookmarks::BookmarkNode*
LocalBookmarkModelMerger::CopyLocalNodeToAccountModel(
const bookmarks::BookmarkNode* local_node,
const bookmarks::BookmarkNode* account_parent) { … }
const bookmarks::BookmarkNode*
LocalBookmarkModelMerger::FindMatchingLocalNodeByUuid(
const bookmarks::BookmarkNode* account_node) const { … }
const bookmarks::BookmarkNode*
LocalBookmarkModelMerger::FindMatchingAccountNodeByUuid(
const bookmarks::BookmarkNode* local_node) const { … }
}