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_SYNC_FILE_SYSTEM_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 const std::string& service_name, | 50 const std::string& service_name, |
51 const fileapi::SyncFileSetCallback& callback); | 51 const fileapi::SyncFileSetCallback& callback); |
52 | 52 |
53 // Returns metadata info for a conflicting file |url|. | 53 // Returns metadata info for a conflicting file |url|. |
54 void GetConflictFileInfo( | 54 void GetConflictFileInfo( |
55 const GURL& app_origin, | 55 const GURL& app_origin, |
56 const std::string& service_name, | 56 const std::string& service_name, |
57 const fileapi::FileSystemURL& url, | 57 const fileapi::FileSystemURL& url, |
58 const fileapi::ConflictFileInfoCallback& callback); | 58 const fileapi::ConflictFileInfoCallback& callback); |
59 | 59 |
| 60 // Returns the file |url|'s sync status. |
| 61 void GetFileSyncStatus( |
| 62 const fileapi::FileSystemURL& url, |
| 63 const fileapi::SyncFileStatusCallback& callback); |
| 64 |
60 void AddSyncEventObserver(SyncEventObserver* observer); | 65 void AddSyncEventObserver(SyncEventObserver* observer); |
61 void RemoveSyncEventObserver(SyncEventObserver* observer); | 66 void RemoveSyncEventObserver(SyncEventObserver* observer); |
62 | 67 |
63 // Enables or disables automatic synchronization process. | 68 // Enables or disables automatic synchronization process. |
64 // If this is enabled the service automatically runs remote/local sync | 69 // If this is enabled the service automatically runs remote/local sync |
65 // process when it detects changes in remote/local filesystem for | 70 // process when it detects changes in remote/local filesystem for |
66 // registered origins. | 71 // registered origins. |
67 // It is enabled by default but can be disabled for testing (or maybe | 72 // It is enabled by default but can be disabled for testing (or maybe |
68 // via an explicit API call). | 73 // via an explicit API call). |
69 void set_auto_sync_enabled(bool flag) { auto_sync_enabled_ = flag; } | 74 void set_auto_sync_enabled(bool flag) { auto_sync_enabled_ = flag; } |
(...skipping 30 matching lines...) Expand all Loading... |
100 void MaybeStartRemoteSync(); | 105 void MaybeStartRemoteSync(); |
101 void MaybeStartLocalSync(); | 106 void MaybeStartLocalSync(); |
102 | 107 |
103 // Callbacks for remote/local sync. | 108 // Callbacks for remote/local sync. |
104 void DidProcessRemoteChange(fileapi::SyncStatusCode status, | 109 void DidProcessRemoteChange(fileapi::SyncStatusCode status, |
105 const fileapi::FileSystemURL& url, | 110 const fileapi::FileSystemURL& url, |
106 fileapi::SyncOperationType type); | 111 fileapi::SyncOperationType type); |
107 void DidProcessLocalChange(fileapi::SyncStatusCode status, | 112 void DidProcessLocalChange(fileapi::SyncStatusCode status, |
108 const fileapi::FileSystemURL& url); | 113 const fileapi::FileSystemURL& url); |
109 | 114 |
| 115 void DidGetLocalChangeStatus(const fileapi::SyncFileStatusCallback& callback, |
| 116 bool has_pending_local_changes); |
| 117 |
110 void OnSyncEnabledForRemoteSync(); | 118 void OnSyncEnabledForRemoteSync(); |
111 | 119 |
112 // RemoteFileSyncService::Observer overrides. | 120 // RemoteFileSyncService::Observer overrides. |
113 virtual void OnLocalChangeAvailable(int64 pending_changes) OVERRIDE; | 121 virtual void OnLocalChangeAvailable(int64 pending_changes) OVERRIDE; |
114 | 122 |
115 // LocalFileSyncService::Observer overrides. | 123 // LocalFileSyncService::Observer overrides. |
116 virtual void OnRemoteChangeAvailable(int64 pending_changes) OVERRIDE; | 124 virtual void OnRemoteChangeAvailable(int64 pending_changes) OVERRIDE; |
117 virtual void OnRemoteServiceStateUpdated( | 125 virtual void OnRemoteServiceStateUpdated( |
118 RemoteServiceState state, | 126 RemoteServiceState state, |
119 const std::string& description) OVERRIDE; | 127 const std::string& description) OVERRIDE; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // ProfileKeyedServiceFactory overrides. | 174 // ProfileKeyedServiceFactory overrides. |
167 virtual ProfileKeyedService* BuildServiceInstanceFor( | 175 virtual ProfileKeyedService* BuildServiceInstanceFor( |
168 Profile* profile) const OVERRIDE; | 176 Profile* profile) const OVERRIDE; |
169 | 177 |
170 mutable scoped_ptr<RemoteFileSyncService> mock_remote_file_service_; | 178 mutable scoped_ptr<RemoteFileSyncService> mock_remote_file_service_; |
171 }; | 179 }; |
172 | 180 |
173 } // namespace sync_file_system | 181 } // namespace sync_file_system |
174 | 182 |
175 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ | 183 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ |
OLD | NEW |