OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 public google_apis::DriveNotificationObserver { | 58 public google_apis::DriveNotificationObserver { |
59 public: | 59 public: |
60 enum ConflictResolutionResult { | 60 enum ConflictResolutionResult { |
61 CONFLICT_RESOLUTION_MARK_CONFLICT, | 61 CONFLICT_RESOLUTION_MARK_CONFLICT, |
62 CONFLICT_RESOLUTION_LOCAL_WIN, | 62 CONFLICT_RESOLUTION_LOCAL_WIN, |
63 CONFLICT_RESOLUTION_REMOTE_WIN, | 63 CONFLICT_RESOLUTION_REMOTE_WIN, |
64 }; | 64 }; |
65 | 65 |
66 typedef base::Callback<void(const SyncStatusCallback& callback)> Task; | 66 typedef base::Callback<void(const SyncStatusCallback& callback)> Task; |
67 | 67 |
68 static const char kServiceName[]; | |
69 static ConflictResolutionPolicy kDefaultPolicy; | 68 static ConflictResolutionPolicy kDefaultPolicy; |
70 | 69 |
71 virtual ~DriveFileSyncService(); | 70 virtual ~DriveFileSyncService(); |
72 | 71 |
73 // Creates DriveFileSyncService. | 72 // Creates DriveFileSyncService. |
74 static scoped_ptr<DriveFileSyncService> Create(Profile* profile); | 73 static scoped_ptr<DriveFileSyncService> Create(Profile* profile); |
75 | 74 |
76 // Creates DriveFileSyncService instance for testing. | 75 // Creates DriveFileSyncService instance for testing. |
77 // |metadata_store| must be initialized beforehand. | 76 // |metadata_store| must be initialized beforehand. |
78 static scoped_ptr<DriveFileSyncService> CreateForTesting( | 77 static scoped_ptr<DriveFileSyncService> CreateForTesting( |
(...skipping 24 matching lines...) Expand all Loading... |
103 const SyncStatusCallback& callback) OVERRIDE; | 102 const SyncStatusCallback& callback) OVERRIDE; |
104 virtual void UninstallOrigin( | 103 virtual void UninstallOrigin( |
105 const GURL& origin, | 104 const GURL& origin, |
106 const SyncStatusCallback& callback) OVERRIDE; | 105 const SyncStatusCallback& callback) OVERRIDE; |
107 virtual void ProcessRemoteChange(const SyncFileCallback& callback) OVERRIDE; | 106 virtual void ProcessRemoteChange(const SyncFileCallback& callback) OVERRIDE; |
108 virtual void SetRemoteChangeProcessor( | 107 virtual void SetRemoteChangeProcessor( |
109 RemoteChangeProcessor* processor) OVERRIDE; | 108 RemoteChangeProcessor* processor) OVERRIDE; |
110 virtual LocalChangeProcessor* GetLocalChangeProcessor() OVERRIDE; | 109 virtual LocalChangeProcessor* GetLocalChangeProcessor() OVERRIDE; |
111 virtual bool IsConflicting(const fileapi::FileSystemURL& url) OVERRIDE; | 110 virtual bool IsConflicting(const fileapi::FileSystemURL& url) OVERRIDE; |
112 virtual RemoteServiceState GetCurrentState() const OVERRIDE; | 111 virtual RemoteServiceState GetCurrentState() const OVERRIDE; |
113 virtual const char* GetServiceName() const OVERRIDE; | |
114 virtual void SetSyncEnabled(bool enabled) OVERRIDE; | 112 virtual void SetSyncEnabled(bool enabled) OVERRIDE; |
115 virtual SyncStatusCode SetConflictResolutionPolicy( | 113 virtual SyncStatusCode SetConflictResolutionPolicy( |
116 ConflictResolutionPolicy resolution) OVERRIDE; | 114 ConflictResolutionPolicy resolution) OVERRIDE; |
117 virtual ConflictResolutionPolicy GetConflictResolutionPolicy() const OVERRIDE; | 115 virtual ConflictResolutionPolicy GetConflictResolutionPolicy() const OVERRIDE; |
118 | 116 |
119 // LocalChangeProcessor overrides. | 117 // LocalChangeProcessor overrides. |
120 virtual void ApplyLocalChange( | 118 virtual void ApplyLocalChange( |
121 const FileChange& change, | 119 const FileChange& change, |
122 const base::FilePath& local_file_path, | 120 const base::FilePath& local_file_path, |
123 const SyncFileMetadata& local_file_metadata, | 121 const SyncFileMetadata& local_file_metadata, |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 RemoteChangeProcessor* remote_change_processor_; | 421 RemoteChangeProcessor* remote_change_processor_; |
424 | 422 |
425 ConflictResolutionPolicy conflict_resolution_; | 423 ConflictResolutionPolicy conflict_resolution_; |
426 | 424 |
427 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); | 425 DISALLOW_COPY_AND_ASSIGN(DriveFileSyncService); |
428 }; | 426 }; |
429 | 427 |
430 } // namespace sync_file_system | 428 } // namespace sync_file_system |
431 | 429 |
432 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ | 430 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_FILE_SYNC_SERVICE_H_ |
OLD | NEW |