| 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_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/chromeos/drive/file_errors.h" | 8 #include "chrome/browser/chromeos/drive/file_errors.h" |
| 9 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" | 9 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" |
| 10 | 10 |
| 11 namespace base { | 11 namespace base { |
| 12 class FilePath; | 12 class FilePath; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace drive { | 15 namespace drive { |
| 16 | 16 |
| 17 class FileChange; |
| 18 |
| 17 // Interface for classes that need to observe events from classes implementing | 19 // Interface for classes that need to observe events from classes implementing |
| 18 // FileSystemInterface. | 20 // FileSystemInterface. |
| 19 // All events are notified on UI thread. | 21 // All events are notified on UI thread. |
| 20 class FileSystemObserver { | 22 class FileSystemObserver { |
| 21 public: | 23 public: |
| 22 // Triggered when a content of a directory has been changed. | 24 // Triggered when a content of a directory has been changed. |
| 23 // |directory_path| is a virtual directory path (/drive/...) representing | 25 // |directory_path| is a virtual directory path (/drive/...) representing |
| 24 // changed directory. | 26 // changed directory. |
| 25 virtual void OnDirectoryChanged(const base::FilePath& directory_path) {} | 27 virtual void OnDirectoryChanged(const base::FilePath& directory_path) {} |
| 28 virtual void OnFileChanged(const FileChange& file_change) {} |
| 26 | 29 |
| 27 // Triggared when a specific drive error occurred. | 30 // Triggared when a specific drive error occurred. |
| 28 // |type| is a type of the error. |file_name| is a virtual path of the entry. | 31 // |type| is a type of the error. |file_name| is a virtual path of the entry. |
| 29 virtual void OnDriveSyncError(file_system::DriveSyncErrorType type, | 32 virtual void OnDriveSyncError(file_system::DriveSyncErrorType type, |
| 30 const base::FilePath& file_path) {} | 33 const base::FilePath& file_path) {} |
| 31 | 34 |
| 32 protected: | 35 protected: |
| 33 virtual ~FileSystemObserver() {} | 36 virtual ~FileSystemObserver() {} |
| 34 }; | 37 }; |
| 35 | 38 |
| 36 } // namespace drive | 39 } // namespace drive |
| 37 | 40 |
| 38 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OBSERVER_H_ | 41 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_OBSERVER_H_ |
| OLD | NEW |