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_CHANGE_LIST_LOADER_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_OBSERVER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_OBSERVER_H_ |
7 | 7 |
8 namespace base { | 8 namespace base { |
9 class FilePath; | 9 class FilePath; |
10 } // namespace base | 10 } // namespace base |
11 | 11 |
12 namespace drive { | 12 namespace drive { |
| 13 class FileChange; |
13 namespace internal { | 14 namespace internal { |
14 | 15 |
15 // Interface for classes that need to observe events from ChangeListLoader. | 16 // Interface for classes that need to observe events from ChangeListLoader. |
16 // All events are notified on UI thread. | 17 // All events are notified on UI thread. |
17 class ChangeListLoaderObserver { | 18 class ChangeListLoaderObserver { |
18 public: | 19 public: |
19 // Triggered when a content of a directory has been changed. | 20 // Triggered when the content of a directory is reloaded. The content may |
20 // |directory_path| is a virtual directory path representing the | 21 // changed. |directory_path| is a virtual directory path representing the |
21 // changed directory. | 22 // reloaded directory. |
22 virtual void OnDirectoryChanged(const base::FilePath& directory_path) {} | 23 virtual void OnDirectoryReloaded(const base::FilePath& directory_path) {} |
| 24 |
| 25 // Triggered when content(s) in drive has been changed. |
| 26 virtual void OnFileChanged(const FileChange& changed_files) {} |
23 | 27 |
24 // Triggered when loading from the server is complete. | 28 // Triggered when loading from the server is complete. |
25 virtual void OnLoadFromServerComplete() {} | 29 virtual void OnLoadFromServerComplete() {} |
26 | 30 |
27 // Triggered when loading is complete for the first time, either from the | 31 // Triggered when loading is complete for the first time, either from the |
28 // the server or the cache. To be precise, for the latter case, we do not | 32 // the server or the cache. To be precise, for the latter case, we do not |
29 // load anything from the cache. We just check that the resource metadata | 33 // load anything from the cache. We just check that the resource metadata |
30 // is stored locally thus can be used. | 34 // is stored locally thus can be used. |
31 virtual void OnInitialLoadComplete() {} | 35 virtual void OnInitialLoadComplete() {} |
32 | 36 |
33 protected: | 37 protected: |
34 virtual ~ChangeListLoaderObserver() {} | 38 virtual ~ChangeListLoaderObserver() {} |
35 }; | 39 }; |
36 | 40 |
37 } // namespace internal | 41 } // namespace internal |
38 } // namespace drive | 42 } // namespace drive |
39 | 43 |
40 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_OBSERVER_H_ | 44 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_OBSERVER_H_ |
OLD | NEW |