Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1346)

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/sync_worker_interface.h

Issue 328063003: [SyncFS] Migrate SyncWorker::Observer to SyncWorkerInterface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/sync_worker.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_callbacks.h" 13 #include "chrome/browser/sync_file_system/sync_callbacks.h"
14 #include "chrome/browser/sync_file_system/sync_direction.h"
13 #include "net/base/network_change_notifier.h" 15 #include "net/base/network_change_notifier.h"
14 16
15 class GURL; 17 class GURL;
16 18
17 namespace base { 19 namespace base {
18 class FilePath; 20 class FilePath;
19 class ListValue; 21 class ListValue;
20 } 22 }
21 23
22 namespace drive { 24 namespace drive {
(...skipping 11 matching lines...) Expand all
34 class SyncFileMetadata; 36 class SyncFileMetadata;
35 37
36 namespace drive_backend { 38 namespace drive_backend {
37 39
38 class MetadataDatabase; 40 class MetadataDatabase;
39 class RemoteChangeProcessorOnWorker; 41 class RemoteChangeProcessorOnWorker;
40 class SyncTaskManager; 42 class SyncTaskManager;
41 43
42 class SyncWorkerInterface { 44 class SyncWorkerInterface {
43 public: 45 public:
46 class Observer {
47 public:
48 virtual void OnPendingFileListUpdated(int item_count) = 0;
49 virtual void OnFileStatusChanged(const fileapi::FileSystemURL& url,
50 SyncFileStatus file_status,
51 SyncAction sync_action,
52 SyncDirection direction) = 0;
53 virtual void UpdateServiceState(RemoteServiceState state,
54 const std::string& description) = 0;
55
56 protected:
57 virtual ~Observer() {}
58 };
59
60 SyncWorkerInterface() {}
44 virtual ~SyncWorkerInterface() {} 61 virtual ~SyncWorkerInterface() {}
45 62
46 // Initializes SyncWorkerInterface after constructions of some member classes. 63 // Initializes SyncWorkerInterface after constructions of some member classes.
47 virtual void Initialize() = 0; 64 virtual void Initialize() = 0;
48 65
49 // See RemoteFileSyncService for the details. 66 // See RemoteFileSyncService for the details.
50 virtual void RegisterOrigin(const GURL& origin, 67 virtual void RegisterOrigin(const GURL& origin,
51 const SyncStatusCallback& callback) = 0; 68 const SyncStatusCallback& callback) = 0;
52 virtual void EnableOrigin(const GURL& origin, 69 virtual void EnableOrigin(const GURL& origin,
53 const SyncStatusCallback& callback) = 0; 70 const SyncStatusCallback& callback) = 0;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 virtual void OnNetworkChanged( 104 virtual void OnNetworkChanged(
88 net::NetworkChangeNotifier::ConnectionType type) = 0; 105 net::NetworkChangeNotifier::ConnectionType type) = 0;
89 106
90 virtual drive::DriveServiceInterface* GetDriveService() = 0; 107 virtual drive::DriveServiceInterface* GetDriveService() = 0;
91 virtual drive::DriveUploaderInterface* GetDriveUploader() = 0; 108 virtual drive::DriveUploaderInterface* GetDriveUploader() = 0;
92 virtual MetadataDatabase* GetMetadataDatabase() = 0; 109 virtual MetadataDatabase* GetMetadataDatabase() = 0;
93 virtual SyncTaskManager* GetSyncTaskManager() = 0; 110 virtual SyncTaskManager* GetSyncTaskManager() = 0;
94 111
95 virtual void DetachFromSequence() = 0; 112 virtual void DetachFromSequence() = 0;
96 113
114 virtual void AddObserver(Observer* observer) = 0;
115
97 private: 116 private:
98 friend class SyncEngineTest; 117 friend class SyncEngineTest;
99 118
100 // TODO(peria): Remove this interface after making FakeSyncWorker class. 119 // TODO(peria): Remove this interface after making FakeSyncWorker class.
101 virtual void SetHasRefreshToken(bool has_refresh_token) = 0; 120 virtual void SetHasRefreshToken(bool has_refresh_token) = 0;
121
122 DISALLOW_COPY_AND_ASSIGN(SyncWorkerInterface);
102 }; 123 };
103 124
104 } // namespace drive_backend 125 } // namespace drive_backend
105 } // namespace sync_file_system 126 } // namespace sync_file_system
106 127
107 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_INTERFACE_H _ 128 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_INTERFACE_H _
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/sync_worker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698