1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_CONFLICT_RESOLUTION_RESOLVER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_CONFLICT_RESOLUTION_RESOLVER_H_
8 #include "chrome/browser/sync_file_system/conflict_resolution_policy.h"
9 #include "chrome/browser/sync_file_system/sync_file_type.h"
15 namespace sync_file_system
{
17 enum ConflictResolution
{
18 CONFLICT_RESOLUTION_UNKNOWN
,
19 CONFLICT_RESOLUTION_MARK_CONFLICT
,
20 CONFLICT_RESOLUTION_LOCAL_WIN
,
21 CONFLICT_RESOLUTION_REMOTE_WIN
,
24 class ConflictResolutionResolver
{
26 explicit ConflictResolutionResolver(ConflictResolutionPolicy policy
);
27 ~ConflictResolutionResolver();
29 // Determine the ConflictResolution.
30 // This may return CONFLICT_RESOLUTION_UNKNOWN if NULL |remote_update_time|
32 // It is invalid to give NULL |local_update_time|.
33 ConflictResolution
Resolve(
34 SyncFileType local_file_type
,
35 const base::Time
& local_update_time
,
36 SyncFileType remote_file_type
,
37 const base::Time
& remote_update_time
);
39 ConflictResolutionPolicy
policy() const { return policy_
; }
40 void set_policy(ConflictResolutionPolicy policy
) { policy_
= policy
; }
43 ConflictResolutionPolicy policy_
;
46 } // namespace sync_file_system
48 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_CONFLICT_RESOLUTION_RESOLVER_H_