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