Chromium Code Reviews| Index: chrome/browser/sync_file_system/remote_sync_operation_resolver.h |
| diff --git a/chrome/browser/sync_file_system/remote_sync_operation_resolver.h b/chrome/browser/sync_file_system/remote_sync_operation_resolver.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6ed34cdd5e8b66b3b9d5dc20c6377cdeb456a1df |
| --- /dev/null |
| +++ b/chrome/browser/sync_file_system/remote_sync_operation_resolver.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_SYNC_OPERATION_RESOLVER_H_ |
| +#define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_SYNC_OPERATION_RESOLVER_H_ |
| + |
| +#include "webkit/fileapi/syncable/file_change.h" |
| +#include "webkit/fileapi/syncable/sync_file_type.h" |
| + |
| +namespace sync_file_system { |
| + |
| +class RemoteSyncOperationResolver { |
| + public: |
| + enum RemoteSyncOperationType { |
|
kinuko
2013/04/24 14:54:50
If this is a nested enum in a class, I think the e
nhiroki
2013/04/25 06:54:43
Done.
|
| + REMOTE_SYNC_OPERATION_ADD_FILE, |
| + REMOTE_SYNC_OPERATION_ADD_DIRECTORY, |
| + REMOTE_SYNC_OPERATION_UPDATE_FILE, |
| + REMOTE_SYNC_OPERATION_DELETE_FILE, |
| + REMOTE_SYNC_OPERATION_DELETE_DIRECTORY, |
| + REMOTE_SYNC_OPERATION_NONE, |
| + REMOTE_SYNC_OPERATION_CONFLICT, |
| + REMOTE_SYNC_OPERATION_RESOLVE_TO_LOCAL, |
| + REMOTE_SYNC_OPERATION_RESOLVE_TO_REMOTE, |
| + REMOTE_SYNC_OPERATION_DELETE_METADATA, |
| + REMOTE_SYNC_OPERATION_FAIL, |
| + }; |
| + |
| + static RemoteSyncOperationType Resolve( |
| + const FileChange& remote_file_change, |
| + const FileChangeList& local_changes, |
| + SyncFileType local_file_type, |
| + bool is_conflicting); |
| + |
| + private: |
| + friend class RemoteSyncOperationResolverTest; |
| + |
| + static RemoteSyncOperationType ResolveForAddOrUpdateFile( |
| + const FileChangeList& local_changes, |
| + SyncFileType local_file_type); |
| + static RemoteSyncOperationType ResolveForAddOrUpdateFileInConflict( |
| + const FileChangeList& local_changes, |
| + SyncFileType local_file_type); |
| + static RemoteSyncOperationType ResolveForAddDirectory( |
| + const FileChangeList& local_changes, |
| + SyncFileType local_file_type); |
| + static RemoteSyncOperationType ResolveForAddDirectoryInConflict( |
| + const FileChangeList& local_changes, |
| + SyncFileType local_file_type); |
| + static RemoteSyncOperationType ResolveForDeleteFile( |
| + const FileChangeList& local_changes, |
| + SyncFileType local_file_type); |
| + static RemoteSyncOperationType ResolveForDeleteFileInConflict( |
| + const FileChangeList& local_changes, |
| + SyncFileType local_file_type); |
| + static RemoteSyncOperationType ResolveForDeleteDirectory( |
| + const FileChangeList& local_changes, |
| + SyncFileType local_file_type); |
| + static RemoteSyncOperationType ResolveForDeleteDirectoryInConflict( |
| + const FileChangeList& local_changes, |
| + SyncFileType local_file_type); |
| +}; |
| + |
| +} // namespace sync_file_system |
| + |
| +#endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_SYNC_OPERATION_RESOLVER_H_ |