#include "chrome/browser/extensions/api/storage/settings_sync_util.h"
#include "base/functional/bind.h"
#include "base/json/json_writer.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/storage/sync_value_store_cache.h"
#include "components/sync/protocol/app_setting_specifics.pb.h"
#include "components/sync/protocol/entity_specifics.pb.h"
#include "components/sync/protocol/extension_setting_specifics.pb.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/api/storage/backend_task_runner.h"
#include "extensions/browser/api/storage/storage_frontend.h"
#include "extensions/common/extension_id.h"
namespace extensions {
namespace settings_sync_util {
namespace {
base::WeakPtr<syncer::SyncableService> GetSyncableServiceOnBackendSequence(
base::WeakPtr<SyncValueStoreCache> sync_cache,
syncer::DataType type) { … }
void PopulateExtensionSettingSpecifics(
const ExtensionId& extension_id,
const std::string& key,
const base::Value& value,
sync_pb::ExtensionSettingSpecifics* specifics) { … }
void PopulateAppSettingSpecifics(const ExtensionId& extension_id,
const std::string& key,
const base::Value& value,
sync_pb::AppSettingSpecifics* specifics) { … }
}
syncer::SyncData CreateData(const ExtensionId& extension_id,
const std::string& key,
const base::Value& value,
syncer::DataType type) { … }
syncer::SyncChange CreateAdd(const ExtensionId& extension_id,
const std::string& key,
const base::Value& value,
syncer::DataType type) { … }
syncer::SyncChange CreateUpdate(const ExtensionId& extension_id,
const std::string& key,
const base::Value& value,
syncer::DataType type) { … }
syncer::SyncChange CreateDelete(const ExtensionId& extension_id,
const std::string& key,
syncer::DataType type) { … }
base::OnceCallback<base::WeakPtr<syncer::SyncableService>()>
GetSyncableServiceProvider(content::BrowserContext* context,
syncer::DataType type) { … }
}
}