| 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_REMOTE_FILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "chrome/browser/sync_file_system/conflict_resolution_policy.h" | 15 #include "chrome/browser/sync_file_system/conflict_resolution_policy.h" |
| 15 #include "chrome/browser/sync_file_system/sync_callbacks.h" | 16 #include "chrome/browser/sync_file_system/sync_callbacks.h" |
| 16 #include "chrome/browser/sync_file_system/sync_file_metadata.h" | 17 #include "chrome/browser/sync_file_system/sync_file_metadata.h" |
| 17 #include "webkit/browser/fileapi/file_system_url.h" | 18 #include "webkit/browser/fileapi/file_system_url.h" |
| 18 | 19 |
| 19 class BrowserContextKeyedServiceFactory; | 20 class BrowserContextKeyedServiceFactory; |
| 20 class GURL; | 21 class GURL; |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class ListValue; | 24 class ListValue; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 SyncFileMetadata metadata; | 105 SyncFileMetadata metadata; |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 enum UninstallFlag { | 108 enum UninstallFlag { |
| 108 UNINSTALL_AND_PURGE_REMOTE, | 109 UNINSTALL_AND_PURGE_REMOTE, |
| 109 UNINSTALL_AND_KEEP_REMOTE, | 110 UNINSTALL_AND_KEEP_REMOTE, |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 // For GetOriginStatusMap. | 113 // For GetOriginStatusMap. |
| 113 typedef std::map<GURL, std::string> OriginStatusMap; | 114 typedef std::map<GURL, std::string> OriginStatusMap; |
| 115 typedef base::Callback<void(scoped_ptr<OriginStatusMap> status_map)> |
| 116 StatusMapCallback; |
| 114 | 117 |
| 115 // For GetRemoteVersions. | 118 // For GetRemoteVersions. |
| 116 typedef base::Callback<void(SyncStatusCode status, | 119 typedef base::Callback<void(SyncStatusCode status, |
| 117 const std::vector<Version>& versions)> | 120 const std::vector<Version>& versions)> |
| 118 RemoteVersionsCallback; | 121 RemoteVersionsCallback; |
| 119 typedef base::Callback<void(SyncStatusCode status, | 122 typedef base::Callback<void(SyncStatusCode status, |
| 120 webkit_blob::ScopedFile downloaded)> | 123 webkit_blob::ScopedFile downloaded)> |
| 121 DownloadVersionCallback; | 124 DownloadVersionCallback; |
| 122 | 125 |
| 123 // For DumpFile. | 126 // For DumpFile. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 188 |
| 186 // Returns true if the file |url| is marked conflicted in the remote service. | 189 // Returns true if the file |url| is marked conflicted in the remote service. |
| 187 virtual bool IsConflicting(const fileapi::FileSystemURL& url) = 0; | 190 virtual bool IsConflicting(const fileapi::FileSystemURL& url) = 0; |
| 188 | 191 |
| 189 // Returns the current remote service state (should equal to the value | 192 // Returns the current remote service state (should equal to the value |
| 190 // returned by the last OnRemoteServiceStateUpdated notification. | 193 // returned by the last OnRemoteServiceStateUpdated notification. |
| 191 virtual RemoteServiceState GetCurrentState() const = 0; | 194 virtual RemoteServiceState GetCurrentState() const = 0; |
| 192 | 195 |
| 193 // Returns all origins along with an arbitrary string description of their | 196 // Returns all origins along with an arbitrary string description of their |
| 194 // corresponding sync statuses. | 197 // corresponding sync statuses. |
| 195 virtual void GetOriginStatusMap(OriginStatusMap* status_map) = 0; | 198 virtual void GetOriginStatusMap(const StatusMapCallback& callback) = 0; |
| 196 | 199 |
| 197 // Returns file metadata for |origin| to call |callback|. | 200 // Returns file metadata for |origin| to call |callback|. |
| 198 virtual void DumpFiles(const GURL& origin, | 201 virtual void DumpFiles(const GURL& origin, |
| 199 const ListCallback& callback) = 0; | 202 const ListCallback& callback) = 0; |
| 200 | 203 |
| 201 // Returns the dump of internal database. | 204 // Returns the dump of internal database. |
| 202 virtual void DumpDatabase(const ListCallback& callback) = 0; | 205 virtual void DumpDatabase(const ListCallback& callback) = 0; |
| 203 | 206 |
| 204 // Enables or disables the background sync. | 207 // Enables or disables the background sync. |
| 205 // Setting this to false should disable the synchronization (and make | 208 // Setting this to false should disable the synchronization (and make |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 242 |
| 240 virtual void PromoteDemotedChanges() = 0; | 243 virtual void PromoteDemotedChanges() = 0; |
| 241 | 244 |
| 242 private: | 245 private: |
| 243 DISALLOW_COPY_AND_ASSIGN(RemoteFileSyncService); | 246 DISALLOW_COPY_AND_ASSIGN(RemoteFileSyncService); |
| 244 }; | 247 }; |
| 245 | 248 |
| 246 } // namespace sync_file_system | 249 } // namespace sync_file_system |
| 247 | 250 |
| 248 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ | 251 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_REMOTE_FILE_SYNC_SERVICE_H_ |
| OLD | NEW |