#include "components/browser_sync/sync_client_utils.h"
#include <algorithm>
#include <functional>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "base/barrier_closure.h"
#include "base/functional/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "components/password_manager/core/browser/password_form.h"
#include "components/password_manager/core/browser/password_store/password_store_consumer.h"
#include "components/password_manager/core/browser/password_store/password_store_interface.h"
#include "components/reading_list/core/dual_reading_list_model.h"
#include "components/sync/base/data_type_histogram.h"
#include "components/sync/base/features.h"
#include "components/sync/service/local_data_description.h"
#include "components/sync_bookmarks/bookmark_model_view.h"
#include "components/sync_bookmarks/local_bookmark_model_merger.h"
#include "components/url_formatter/elide_url.h"
#include "ui/base/models/tree_node_iterator.h"
namespace browser_sync {
namespace {
const syncer::DataTypeSet kSupportedTypes = …;
template <typename ContainerT, typename F>
syncer::LocalDataDescription CreateLocalDataDescription(ContainerT&& items,
F&& url_extractor) { … }
std::vector<GURL> GetAllUserBookmarksExcludingFolders(
sync_bookmarks::BookmarkModelView* model) { … }
base::Time GetLatestOfTimeLastUsedOrModifiedOrCreated(
const password_manager::PasswordForm& form) { … }
syncer::DataTypeSet FilterUsableTypes(
syncer::DataTypeSet types,
password_manager::PasswordStoreInterface* profile_password_store,
password_manager::PasswordStoreInterface* account_password_store,
sync_bookmarks::BookmarkModelView* local_bookmark_model_view,
sync_bookmarks::BookmarkModelView* account_bookmark_model_view,
reading_list::DualReadingListModel* reading_list_model) { … }
}
class LocalDataQueryHelper::LocalDataQueryRequest
: public password_manager::PasswordStoreConsumer { … };
LocalDataQueryHelper::LocalDataQueryHelper(
password_manager::PasswordStoreInterface* profile_password_store,
password_manager::PasswordStoreInterface* account_password_store,
bookmarks::BookmarkModel* bookmark_model,
reading_list::DualReadingListModel* dual_reading_list_model)
: … { … }
LocalDataQueryHelper::~LocalDataQueryHelper() = default;
void LocalDataQueryHelper::Run(
syncer::DataTypeSet types,
base::OnceCallback<void(
std::map<syncer::DataType, syncer::LocalDataDescription>)> callback) { … }
void LocalDataQueryHelper::OnRequestComplete(
LocalDataQueryRequest* request,
base::OnceCallback<void(
std::map<syncer::DataType, syncer::LocalDataDescription>)> callback) { … }
class LocalDataMigrationHelper::LocalDataMigrationRequest
: public password_manager::PasswordStoreConsumer { … };
LocalDataMigrationHelper::LocalDataMigrationHelper(
password_manager::PasswordStoreInterface* profile_password_store,
password_manager::PasswordStoreInterface* account_password_store,
bookmarks::BookmarkModel* bookmark_model,
reading_list::DualReadingListModel* dual_reading_list_model)
: … { … }
LocalDataMigrationHelper::~LocalDataMigrationHelper() = default;
void LocalDataMigrationHelper::Run(syncer::DataTypeSet types) { … }
syncer::DataTypeSet LocalDataMigrationHelper::GetTypesWithOngoingMigrations()
const { … }
void LocalDataMigrationHelper::OnRequestComplete(
LocalDataMigrationRequest* request) { … }
}