| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_INTERFACE_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/sync_file_system/remote_file_sync_service.h" |
| 12 #include "net/base/network_change_notifier.h" |
| 13 |
| 14 class GURL; |
| 15 class FileChange; |
| 16 class SyncFileMetadata; |
| 17 class SyncStatusCallback; |
| 18 |
| 19 namespace base { |
| 20 class FilePath; |
| 21 class ListValue; |
| 22 } |
| 23 |
| 24 namespace drive { |
| 25 class DriveServiceInterface; |
| 26 class DriveUploaderInterface; |
| 27 } |
| 28 |
| 29 namespace fileapi { |
| 30 class FileSystemURL; |
| 31 } |
| 32 |
| 33 namespace sync_file_system { |
| 34 namespace drive_backend { |
| 35 |
| 36 class MetadataDatabase; |
| 37 class RemoteChangeProcessorOnWorker; |
| 38 class SyncTaskManager; |
| 39 |
| 40 class SyncWorkerInterface { |
| 41 public: |
| 42 virtual ~SyncWorkerInterface() {} |
| 43 |
| 44 // Initializes SyncWorkerInterface after constructions of some member classes. |
| 45 virtual void Initialize() = 0; |
| 46 |
| 47 // See RemoteFileSyncService for the details. |
| 48 virtual void RegisterOrigin(const GURL& origin, |
| 49 const SyncStatusCallback& callback) = 0; |
| 50 virtual void EnableOrigin(const GURL& origin, |
| 51 const SyncStatusCallback& callback) = 0; |
| 52 virtual void DisableOrigin(const GURL& origin, |
| 53 const SyncStatusCallback& callback) = 0; |
| 54 virtual void UninstallOrigin( |
| 55 const GURL& origin, |
| 56 RemoteFileSyncService::UninstallFlag flag, |
| 57 const SyncStatusCallback& callback) = 0; |
| 58 virtual void ProcessRemoteChange(const SyncFileCallback& callback) = 0; |
| 59 virtual void SetRemoteChangeProcessor( |
| 60 RemoteChangeProcessorOnWorker* remote_change_processor_on_worker) = 0; |
| 61 virtual RemoteServiceState GetCurrentState() const = 0; |
| 62 virtual void GetOriginStatusMap( |
| 63 const RemoteFileSyncService::StatusMapCallback& callback) = 0; |
| 64 virtual scoped_ptr<base::ListValue> DumpFiles(const GURL& origin) = 0; |
| 65 virtual scoped_ptr<base::ListValue> DumpDatabase() = 0; |
| 66 virtual void SetSyncEnabled(bool enabled) = 0; |
| 67 virtual void PromoteDemotedChanges() = 0; |
| 68 |
| 69 // See LocalChangeProcessor for the details. |
| 70 virtual void ApplyLocalChange( |
| 71 const FileChange& local_change, |
| 72 const base::FilePath& local_path, |
| 73 const SyncFileMetadata& local_metadata, |
| 74 const fileapi::FileSystemURL& url, |
| 75 const SyncStatusCallback& callback) = 0; |
| 76 |
| 77 // See drive::DriveNotificationObserver for the details. |
| 78 virtual void OnNotificationReceived() = 0; |
| 79 |
| 80 // See drive::DriveServiceObserver for the details. |
| 81 virtual void OnReadyToSendRequests(const std::string& account_id) = 0; |
| 82 virtual void OnRefreshTokenInvalid() = 0; |
| 83 |
| 84 // See net::NetworkChangeNotifier::NetworkChangeObserver for the details. |
| 85 virtual void OnNetworkChanged( |
| 86 net::NetworkChangeNotifier::ConnectionType type) = 0; |
| 87 |
| 88 virtual drive::DriveServiceInterface* GetDriveService() = 0; |
| 89 virtual drive::DriveUploaderInterface* GetDriveUploader() = 0; |
| 90 virtual MetadataDatabase* GetMetadataDatabase() = 0; |
| 91 virtual SyncTaskManager* GetSyncTaskManager() = 0; |
| 92 |
| 93 virtual void DetachFromSequence() = 0; |
| 94 |
| 95 private: |
| 96 friend class SyncEngineTest; |
| 97 |
| 98 // TODO(peria): Remove this interface after making FakeSyncWorker class. |
| 99 virtual void SetHasRefreshToken(bool has_refresh_token) = 0; |
| 100 }; |
| 101 |
| 102 } // namespace drive_backend |
| 103 } // namespace sync_file_system |
| 104 |
| 105 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_INTERFACE_H
_ |
| OLD | NEW |