| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class SyncProcessRunner; | 42 class SyncProcessRunner; |
| 43 | 43 |
| 44 class SyncFileSystemService | 44 class SyncFileSystemService |
| 45 : public KeyedService, | 45 : public KeyedService, |
| 46 public ProfileSyncServiceObserver, | 46 public ProfileSyncServiceObserver, |
| 47 public FileStatusObserver, | 47 public FileStatusObserver, |
| 48 public content::NotificationObserver, | 48 public content::NotificationObserver, |
| 49 public base::SupportsWeakPtr<SyncFileSystemService> { | 49 public base::SupportsWeakPtr<SyncFileSystemService> { |
| 50 public: | 50 public: |
| 51 typedef base::Callback<void(const base::ListValue&)> DumpFilesCallback; | 51 typedef base::Callback<void(const base::ListValue&)> DumpFilesCallback; |
| 52 typedef base::Callback<void(const RemoteFileSyncService::OriginStatusMap&)> |
| 53 ExtensionStatusMapCallback; |
| 52 | 54 |
| 53 // KeyedService overrides. | 55 // KeyedService overrides. |
| 54 virtual void Shutdown() OVERRIDE; | 56 virtual void Shutdown() OVERRIDE; |
| 55 | 57 |
| 56 void InitializeForApp( | 58 void InitializeForApp( |
| 57 fileapi::FileSystemContext* file_system_context, | 59 fileapi::FileSystemContext* file_system_context, |
| 58 const GURL& app_origin, | 60 const GURL& app_origin, |
| 59 const SyncStatusCallback& callback); | 61 const SyncStatusCallback& callback); |
| 60 | 62 |
| 61 SyncServiceState GetSyncServiceState(); | 63 SyncServiceState GetSyncServiceState(); |
| 62 void GetExtensionStatusMap(std::map<GURL, std::string>* status_map); | 64 void GetExtensionStatusMap(const ExtensionStatusMapCallback& callback); |
| 63 void DumpFiles(const GURL& origin, const DumpFilesCallback& callback); | 65 void DumpFiles(const GURL& origin, const DumpFilesCallback& callback); |
| 64 void DumpDatabase(const DumpFilesCallback& callback); | 66 void DumpDatabase(const DumpFilesCallback& callback); |
| 65 | 67 |
| 66 // Returns the file |url|'s sync status. | 68 // Returns the file |url|'s sync status. |
| 67 void GetFileSyncStatus( | 69 void GetFileSyncStatus( |
| 68 const fileapi::FileSystemURL& url, | 70 const fileapi::FileSystemURL& url, |
| 69 const SyncFileStatusCallback& callback); | 71 const SyncFileStatusCallback& callback); |
| 70 | 72 |
| 71 void AddSyncEventObserver(SyncEventObserver* observer); | 73 void AddSyncEventObserver(SyncEventObserver* observer); |
| 72 void RemoveSyncEventObserver(SyncEventObserver* observer); | 74 void RemoveSyncEventObserver(SyncEventObserver* observer); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 void DidDumpFiles(const GURL& app_origin, | 108 void DidDumpFiles(const GURL& app_origin, |
| 107 const DumpFilesCallback& callback, | 109 const DumpFilesCallback& callback, |
| 108 scoped_ptr<base::ListValue> files); | 110 scoped_ptr<base::ListValue> files); |
| 109 | 111 |
| 110 void DidDumpDatabase(const DumpFilesCallback& callback, | 112 void DidDumpDatabase(const DumpFilesCallback& callback, |
| 111 scoped_ptr<base::ListValue> list); | 113 scoped_ptr<base::ListValue> list); |
| 112 void DidDumpV2Database(const DumpFilesCallback& callback, | 114 void DidDumpV2Database(const DumpFilesCallback& callback, |
| 113 scoped_ptr<base::ListValue> v1list, | 115 scoped_ptr<base::ListValue> v1list, |
| 114 scoped_ptr<base::ListValue> v2list); | 116 scoped_ptr<base::ListValue> v2list); |
| 115 | 117 |
| 118 void DidGetExtensionStatusMap( |
| 119 const ExtensionStatusMapCallback& callback, |
| 120 scoped_ptr<RemoteFileSyncService::OriginStatusMap> status_map); |
| 121 void DidGetV2ExtensionStatusMap( |
| 122 const ExtensionStatusMapCallback& callback, |
| 123 scoped_ptr<RemoteFileSyncService::OriginStatusMap> status_map_v1, |
| 124 scoped_ptr<RemoteFileSyncService::OriginStatusMap> status_map_v2); |
| 125 |
| 116 // Overrides sync_enabled_ setting. This should be called only by tests. | 126 // Overrides sync_enabled_ setting. This should be called only by tests. |
| 117 void SetSyncEnabledForTesting(bool enabled); | 127 void SetSyncEnabledForTesting(bool enabled); |
| 118 | 128 |
| 119 void DidGetLocalChangeStatus(const SyncFileStatusCallback& callback, | 129 void DidGetLocalChangeStatus(const SyncFileStatusCallback& callback, |
| 120 SyncStatusCode status, | 130 SyncStatusCode status, |
| 121 bool has_pending_local_changes); | 131 bool has_pending_local_changes); |
| 122 | 132 |
| 123 void OnRemoteServiceStateUpdated(RemoteServiceState state, | 133 void OnRemoteServiceStateUpdated(RemoteServiceState state, |
| 124 const std::string& description); | 134 const std::string& description); |
| 125 | 135 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 bool sync_enabled_; | 188 bool sync_enabled_; |
| 179 | 189 |
| 180 ObserverList<SyncEventObserver> observers_; | 190 ObserverList<SyncEventObserver> observers_; |
| 181 | 191 |
| 182 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemService); | 192 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemService); |
| 183 }; | 193 }; |
| 184 | 194 |
| 185 } // namespace sync_file_system | 195 } // namespace sync_file_system |
| 186 | 196 |
| 187 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ | 197 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ |
| OLD | NEW |