#ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_V1_LOCAL_SYNC_OPERATION_RESOLVER_H_
#define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_V1_LOCAL_SYNC_OPERATION_RESOLVER_H_
#include "base/gtest_prod_util.h"
#include "chrome/browser/sync_file_system/file_change.h"
#include "chrome/browser/sync_file_system/sync_file_type.h"
#include "chrome/browser/sync_file_system/sync_operation_type.h"
namespace sync_file_system {
class DriveMetadata;
class FileChange;
class LocalSyncOperationResolver {
public:
static SyncOperationType Resolve(
const FileChange& local_file_change,
const FileChange* remote_file_change,
const DriveMetadata* drive_metadata);
private:
static SyncOperationType ResolveForAddOrUpdateFile(
const FileChange* remote_file_change,
SyncFileType remote_file_type_in_metadata);
static SyncOperationType ResolveForAddOrUpdateFileInConflict(
const FileChange* remote_file_change);
static SyncOperationType ResolveForAddDirectory(
const FileChange* remote_file_change,
SyncFileType remote_file_type_in_metadata);
static SyncOperationType ResolveForAddDirectoryInConflict();
static SyncOperationType ResolveForDelete(
const FileChange* remote_file_change,
SyncFileType remote_file_type_in_metadata);
static SyncOperationType ResolveForDeleteInConflict(
const FileChange* remote_file_change);
FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest,
ResolveForAddOrUpdateFile);
FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest,
ResolveForAddOrUpdateFileInConflict);
FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest,
ResolveForAddDirectory);
FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest,
ResolveForAddDirectoryInConflict);
FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest,
ResolveForDelete);
FRIEND_TEST_ALL_PREFIXES(LocalSyncOperationResolverTest,
ResolveForDeleteInConflict);
};
}
#endif