OLD | NEW |
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_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_OBSERVER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_OBSERVER_H_ |
7 | 7 |
8 namespace base { | 8 namespace base { |
9 class FilePath; | 9 class FilePath; |
10 } | 10 } |
11 | 11 |
12 namespace drive { | 12 namespace drive { |
| 13 class FileChange; |
| 14 |
13 namespace file_system { | 15 namespace file_system { |
14 | 16 |
15 // Error type of sync client. | 17 // Error type of sync client. |
16 // Keep it synced with "DriveSyncErrorType" in file_manager_private.idl. | 18 // Keep it synced with "DriveSyncErrorType" in file_manager_private.idl. |
17 enum DriveSyncErrorType { | 19 enum DriveSyncErrorType { |
18 // Request to delete a file without permission. | 20 // Request to delete a file without permission. |
19 DRIVE_SYNC_ERROR_DELETE_WITHOUT_PERMISSION, | 21 DRIVE_SYNC_ERROR_DELETE_WITHOUT_PERMISSION, |
20 // Google Drive is temporary unavailable. | 22 // Google Drive is temporary unavailable. |
21 DRIVE_SYNC_ERROR_SERVICE_UNAVAILABLE, | 23 DRIVE_SYNC_ERROR_SERVICE_UNAVAILABLE, |
22 // Errors other than above ones. No fallback is provided for the error. | 24 // Errors other than above ones. No fallback is provided for the error. |
23 DRIVE_SYNC_ERROR_MISC, | 25 DRIVE_SYNC_ERROR_MISC, |
24 }; | 26 }; |
25 | 27 |
26 // Passes notifications from Drive operations back to the file system. | 28 // Passes notifications from Drive operations back to the file system. |
27 class OperationObserver { | 29 class OperationObserver { |
28 public: | 30 public: |
29 // Sent when a content of a directory has been changed. | 31 // Sent when a content of a directory has been changed. |
30 // |directory_path| is a virtual directory path representing the | 32 // |directory_path| is a virtual directory path representing the |
31 // changed directory. | 33 // changed directory. |
32 virtual void OnDirectoryChangedByOperation( | 34 virtual void OnFileChangedByOperation(const FileChange& changed_files) = 0; |
33 const base::FilePath& directory_path) = 0; | |
34 | 35 |
35 // Sent when an entry is updated and sync is needed. | 36 // Sent when an entry is updated and sync is needed. |
36 virtual void OnEntryUpdatedByOperation(const std::string& local_id) {} | 37 virtual void OnEntryUpdatedByOperation(const std::string& local_id) {} |
37 | 38 |
38 // Sent when a specific drive sync error occurred. | 39 // Sent when a specific drive sync error occurred. |
39 // |local_id| is the local ID of the resource entry. | 40 // |local_id| is the local ID of the resource entry. |
40 virtual void OnDriveSyncError(DriveSyncErrorType type, | 41 virtual void OnDriveSyncError(DriveSyncErrorType type, |
41 const std::string& local_id) {} | 42 const std::string& local_id) {} |
42 }; | 43 }; |
43 | 44 |
44 } // namespace file_system | 45 } // namespace file_system |
45 } // namespace drive | 46 } // namespace drive |
46 | 47 |
47 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_OBSERVER_H_ | 48 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OPERATION_OBSERVER_H_ |
OLD | NEW |