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_CACHE_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_OBSERVER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_OBSERVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 namespace drive { | 10 namespace drive { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 // Interface for classes that need to observe events from FileCache. | 13 // Interface for classes that need to observe events from FileCache. |
14 // All events are notified on UI thread. | 14 // All events are notified on UI thread. |
15 class FileCacheObserver { | 15 class FileCacheObserver { |
16 public: | 16 public: |
17 // Triggered when a file has been pinned successfully. | 17 // Triggered when a file has been pinned successfully. |
18 virtual void OnCachePinned(const std::string& resource_id, | 18 virtual void OnCachePinned(const std::string& resource_id, |
19 const std::string& md5) {} | 19 const std::string& md5) {} |
20 | 20 |
21 // Triggered when a file has been unpinned successfully. | 21 // Triggered when a file has been unpinned successfully. |
22 virtual void OnCacheUnpinned(const std::string& resource_id, | 22 virtual void OnCacheUnpinned(const std::string& resource_id, |
23 const std::string& md5) {} | 23 const std::string& md5) {} |
24 | 24 |
25 // Triggered when a dirty file has been committed (saved) successfully. | |
26 virtual void OnCacheCommitted(const std::string& resource_id) {} | |
27 | |
28 protected: | 25 protected: |
29 virtual ~FileCacheObserver() {} | 26 virtual ~FileCacheObserver() {} |
30 }; | 27 }; |
31 | 28 |
32 } // namespace internal | 29 } // namespace internal |
33 } // namespace drive | 30 } // namespace drive |
34 | 31 |
35 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_OBSERVER_H_ | 32 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CACHE_OBSERVER_H_ |
OLD | NEW |