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

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

Issue 318353002: [SyncFS] Create SyncWorkerInterface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
OLDNEW
(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/files/file_path.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/values.h"
13 #include "chrome/browser/sync_file_system/file_change.h"
14 #include "chrome/browser/sync_file_system/remote_file_sync_service.h"
15 #include "chrome/browser/sync_file_system/sync_callbacks.h"
16 #include "chrome/browser/sync_file_system/sync_file_metadata.h"
17 #include "net/base/network_change_notifier.h"
18 #include "url/gurl.h"
19 #include "webkit/browser/fileapi/file_system_url.h"
tzik 2014/06/09 08:04:23 Forward declarations seem to be able to replace so
peria 2014/06/10 04:31:08 Done.
20
21 namespace drive {
22 class DriveServiceInterface;
23 class DriveUploaderInterface;
24 }
25
26 namespace sync_file_system {
27 namespace drive_backend {
28
29 class MetadataDatabase;
30 class RemoteChangeProcessorOnWorker;
31 class SyncTaskManager;
32
33 class SyncWorkerInterface {
34 public:
35 virtual ~SyncWorkerInterface() {}
36
37 // Initialize SyncWorkerInterface after constructions of some member classes.
nhiroki 2014/06/10 04:00:48 nit: s/Initialize/Initializes/
peria 2014/06/10 04:31:07 Done.
38 virtual void Initialize() = 0;
39
40 // See RemoteFileSyncService for the details.
41 virtual void RegisterOrigin(const GURL& origin,
42 const SyncStatusCallback& callback) = 0;
43 virtual void EnableOrigin(const GURL& origin,
44 const SyncStatusCallback& callback) = 0;
45 virtual void DisableOrigin(const GURL& origin,
46 const SyncStatusCallback& callback) = 0;
47 virtual void UninstallOrigin(
48 const GURL& origin,
49 RemoteFileSyncService::UninstallFlag flag,
50 const SyncStatusCallback& callback) = 0;
51 virtual void ProcessRemoteChange(const SyncFileCallback& callback) = 0;
52 virtual void SetRemoteChangeProcessor(
53 RemoteChangeProcessorOnWorker* remote_change_processor_on_worker) = 0;
54 virtual RemoteServiceState GetCurrentState() const = 0;
55 virtual void GetOriginStatusMap(
56 const RemoteFileSyncService::StatusMapCallback& callback) = 0;
57 virtual scoped_ptr<base::ListValue> DumpFiles(const GURL& origin) = 0;
58 virtual scoped_ptr<base::ListValue> DumpDatabase() = 0;
59 virtual void SetSyncEnabled(bool enabled) = 0;
60 virtual void PromoteDemotedChanges() = 0;
61
62 // See LocalChangeProcessor for the details.
63 virtual void ApplyLocalChange(
64 const FileChange& local_change,
65 const base::FilePath& local_path,
66 const SyncFileMetadata& local_metadata,
67 const fileapi::FileSystemURL& url,
68 const SyncStatusCallback& callback) = 0;
69
70 // See drive::DriveNotificationObserver for the details.
71 virtual void OnNotificationReceived() = 0;
72
73 // See drive::DriveServiceObserver for the details.
74 virtual void OnReadyToSendRequests(const std::string& account_id) = 0;
75 virtual void OnRefreshTokenInvalid() = 0;
76
77 // See net::NetworkChangeNotifier::NetworkChangeObserver for the details.
78 virtual void OnNetworkChanged(
79 net::NetworkChangeNotifier::ConnectionType type) = 0;
80
81 virtual drive::DriveServiceInterface* GetDriveService() = 0;
82 virtual drive::DriveUploaderInterface* GetDriveUploader() = 0;
83 virtual MetadataDatabase* GetMetadataDatabase() = 0;
84 virtual SyncTaskManager* GetSyncTaskManager() = 0;
85
86 virtual void DetachFromSequence() = 0;
87
88 private:
89 friend class SyncEngineTest;
90
91 // TODO(peria): Remove this interface after making FakeSyncWorker class.
92 virtual void SetHasRefreshToken(bool has_refresh_token) = 0;
93 };
94
95 } // namespace drive_backend
96 } // namespace sync_file_system
97
98 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_WORKER_INTERFACE_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698