Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync_file_system / conflict_resolution_resolver.h
blob43ed76996ba9e5f1684ae4e80b6b6e8c38d37862
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"
11 namespace base {
12 class Time;
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 {
25 public:
26 explicit ConflictResolutionResolver(ConflictResolutionPolicy policy);
27 ~ConflictResolutionResolver();
29 // Determine the ConflictResolution.
30 // This may return CONFLICT_RESOLUTION_UNKNOWN if NULL |remote_update_time|
31 // is given.
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; }
42 private:
43 ConflictResolutionPolicy policy_;
46 } // namespace sync_file_system
48 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_CONFLICT_RESOLUTION_RESOLVER_H_