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

Side by Side Diff: chrome/browser/sync_file_system/sync_event_observer.h

Issue 11299008: Remote service state handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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/remote_file_sync_service.h ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_SYNC_EVENT_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_EVENT_OBSERVER_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_EVENT_OBSERVER_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_EVENT_OBSERVER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "webkit/fileapi/syncable/sync_status_code.h" 10 #include "webkit/fileapi/syncable/sync_status_code.h"
(...skipping 18 matching lines...) Expand all
29 29
30 // A file or directory was deleted. 30 // A file or directory was deleted.
31 SYNC_OPERATION_DELETE, 31 SYNC_OPERATION_DELETE,
32 }; 32 };
33 33
34 enum SyncServiceState { 34 enum SyncServiceState {
35 // The sync service is being initialized (e.g. restoring data from the 35 // The sync service is being initialized (e.g. restoring data from the
36 // database, checking connectivity and authenticating to the service etc). 36 // database, checking connectivity and authenticating to the service etc).
37 SYNC_SERVICE_INITIALIZING, 37 SYNC_SERVICE_INITIALIZING,
38 38
39 // The sync service has detected changes in local or remote side and is 39 // The sync service is up and running.
40 // performing file synchronization. 40 SYNC_SERVICE_RUNNING,
41 SYNC_SERVICE_SYNCING,
42 41
43 // The sync service is up and runnable but currently is idle (i.e. no 42 // The sync service is not synchronizing files because the remote service
44 // file activities which require sync operation in remote and local side). 43 // needs to be authenticated by the user to proceed.
45 SYNC_SERVICE_IDLE, 44 SYNC_SERVICE_AUTHENTICATION_REQUIRED,
46 45
47 // The sync service is (temporarily) suspended due to some recoverable 46 // The sync service is not synchronizing files because the remote service
48 // errors, e.g. network is offline, the user is not authenticated, remote 47 // is (temporarily) unavailable due to some recoverable errors, e.g.
49 // service is down or not reachable etc. More details should be given 48 // network is offline, the remote service is down or not
50 // by |description| parameter in OnSyncStateUpdated (which could contain 49 // reachable etc. More details should be given by |description| parameter
51 // service-specific details). 50 // in OnSyncStateUpdated (which could contain service-specific details).
52 // TODO(kinuko): Revisit this to see if we need a separate state for
53 // 'auth required'.
54 SYNC_SERVICE_TEMPORARY_UNAVAILABLE, 51 SYNC_SERVICE_TEMPORARY_UNAVAILABLE,
55 52
56 // The sync service is disabled and the content will never sync. 53 // The sync service is disabled and the content will never sync.
57 SYNC_SERVICE_DISABLED, 54 SYNC_SERVICE_DISABLED,
58 }; 55 };
59 56
60 // Reports there was an error in the sync file system backend. 57 // Reports there was a state change in the sync file system backend.
61 virtual void OnSyncStateUpdated(fileapi::SyncServiceState state, 58 virtual void OnSyncStateUpdated(fileapi::SyncServiceState state,
62 const std::string& description) = 0; 59 const std::string& description) = 0;
63 60
64 // Reports the file |url| was updated for |operation| 61 // Reports the file |url| was updated for |operation|
65 // by the sync file system backend. 62 // by the sync file system backend.
66 virtual void OnFileSynced(fileapi::SyncStatusCode status, 63 virtual void OnFileSynced(fileapi::SyncStatusCode status,
67 SyncOperation operation, 64 SyncOperation operation,
68 const FileSystemURL& url) = 0; 65 const FileSystemURL& url) = 0;
69 66
70 private: 67 private:
71 DISALLOW_COPY_AND_ASSIGN(SyncEventObserver); 68 DISALLOW_COPY_AND_ASSIGN(SyncEventObserver);
72 }; 69 };
73 70
74 } // namespace sync_file_system 71 } // namespace sync_file_system
75 72
76 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_EVENT_OBSERVER_H_ 73 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_EVENT_OBSERVER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync_file_system/remote_file_sync_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698