OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_DRIVE_BACKEND_SYNC_WORKER_INTERFACE_H_ | 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_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_INTERFACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "chrome/browser/sync_file_system/remote_file_sync_service.h" | 11 #include "chrome/browser/sync_file_system/remote_file_sync_service.h" |
12 #include "chrome/browser/sync_file_system/sync_action.h" | 12 #include "chrome/browser/sync_file_system/sync_action.h" |
13 #include "chrome/browser/sync_file_system/sync_callbacks.h" | 13 #include "chrome/browser/sync_file_system/sync_callbacks.h" |
14 #include "chrome/browser/sync_file_system/sync_direction.h" | 14 #include "chrome/browser/sync_file_system/sync_direction.h" |
15 #include "net/base/network_change_notifier.h" | 15 #include "net/base/network_change_notifier.h" |
16 | 16 |
17 class GURL; | 17 class GURL; |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class FilePath; | 20 class FilePath; |
21 class ListValue; | 21 class ListValue; |
22 } | 22 } |
23 | 23 |
24 namespace drive { | 24 namespace drive { |
25 class DriveServiceInterface; | 25 class DriveServiceInterface; |
26 class DriveUploaderInterface; | 26 class DriveUploaderInterface; |
27 } | 27 } |
28 | 28 |
29 namespace fileapi { | 29 namespace storage { |
30 class FileSystemURL; | 30 class FileSystemURL; |
31 } | 31 } |
32 | 32 |
33 namespace sync_file_system { | 33 namespace sync_file_system { |
34 | 34 |
35 class FileChange; | 35 class FileChange; |
36 class SyncFileMetadata; | 36 class SyncFileMetadata; |
37 | 37 |
38 namespace drive_backend { | 38 namespace drive_backend { |
39 | 39 |
40 class MetadataDatabase; | 40 class MetadataDatabase; |
41 class RemoteChangeProcessorOnWorker; | 41 class RemoteChangeProcessorOnWorker; |
42 class SyncEngineContext; | 42 class SyncEngineContext; |
43 class SyncTaskManager; | 43 class SyncTaskManager; |
44 | 44 |
45 class SyncWorkerInterface { | 45 class SyncWorkerInterface { |
46 public: | 46 public: |
47 class Observer { | 47 class Observer { |
48 public: | 48 public: |
49 virtual void OnPendingFileListUpdated(int item_count) = 0; | 49 virtual void OnPendingFileListUpdated(int item_count) = 0; |
50 virtual void OnFileStatusChanged(const fileapi::FileSystemURL& url, | 50 virtual void OnFileStatusChanged(const storage::FileSystemURL& url, |
51 SyncFileStatus file_status, | 51 SyncFileStatus file_status, |
52 SyncAction sync_action, | 52 SyncAction sync_action, |
53 SyncDirection direction) = 0; | 53 SyncDirection direction) = 0; |
54 virtual void UpdateServiceState(RemoteServiceState state, | 54 virtual void UpdateServiceState(RemoteServiceState state, |
55 const std::string& description) = 0; | 55 const std::string& description) = 0; |
56 | 56 |
57 protected: | 57 protected: |
58 virtual ~Observer() {} | 58 virtual ~Observer() {} |
59 }; | 59 }; |
60 | 60 |
(...skipping 20 matching lines...) Expand all Loading... |
81 RemoteChangeProcessorOnWorker* remote_change_processor_on_worker) = 0; | 81 RemoteChangeProcessorOnWorker* remote_change_processor_on_worker) = 0; |
82 virtual RemoteServiceState GetCurrentState() const = 0; | 82 virtual RemoteServiceState GetCurrentState() const = 0; |
83 virtual void GetOriginStatusMap( | 83 virtual void GetOriginStatusMap( |
84 const RemoteFileSyncService::StatusMapCallback& callback) = 0; | 84 const RemoteFileSyncService::StatusMapCallback& callback) = 0; |
85 virtual scoped_ptr<base::ListValue> DumpFiles(const GURL& origin) = 0; | 85 virtual scoped_ptr<base::ListValue> DumpFiles(const GURL& origin) = 0; |
86 virtual scoped_ptr<base::ListValue> DumpDatabase() = 0; | 86 virtual scoped_ptr<base::ListValue> DumpDatabase() = 0; |
87 virtual void SetSyncEnabled(bool enabled) = 0; | 87 virtual void SetSyncEnabled(bool enabled) = 0; |
88 virtual void PromoteDemotedChanges(const base::Closure& callback) = 0; | 88 virtual void PromoteDemotedChanges(const base::Closure& callback) = 0; |
89 | 89 |
90 // See LocalChangeProcessor for the details. | 90 // See LocalChangeProcessor for the details. |
91 virtual void ApplyLocalChange( | 91 virtual void ApplyLocalChange(const FileChange& local_change, |
92 const FileChange& local_change, | 92 const base::FilePath& local_path, |
93 const base::FilePath& local_path, | 93 const SyncFileMetadata& local_metadata, |
94 const SyncFileMetadata& local_metadata, | 94 const storage::FileSystemURL& url, |
95 const fileapi::FileSystemURL& url, | 95 const SyncStatusCallback& callback) = 0; |
96 const SyncStatusCallback& callback) = 0; | |
97 | 96 |
98 virtual void ActivateService(RemoteServiceState service_state, | 97 virtual void ActivateService(RemoteServiceState service_state, |
99 const std::string& description) = 0; | 98 const std::string& description) = 0; |
100 virtual void DeactivateService(const std::string& description) = 0; | 99 virtual void DeactivateService(const std::string& description) = 0; |
101 | 100 |
102 virtual void DetachFromSequence() = 0; | 101 virtual void DetachFromSequence() = 0; |
103 | 102 |
104 virtual void AddObserver(Observer* observer) = 0; | 103 virtual void AddObserver(Observer* observer) = 0; |
105 | 104 |
106 private: | 105 private: |
107 friend class SyncEngineTest; | 106 friend class SyncEngineTest; |
108 | 107 |
109 DISALLOW_COPY_AND_ASSIGN(SyncWorkerInterface); | 108 DISALLOW_COPY_AND_ASSIGN(SyncWorkerInterface); |
110 }; | 109 }; |
111 | 110 |
112 } // namespace drive_backend | 111 } // namespace drive_backend |
113 } // namespace sync_file_system | 112 } // namespace sync_file_system |
114 | 113 |
115 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_INTERFACE_H
_ | 114 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_INTERFACE_H
_ |
OLD | NEW |