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_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 13 matching lines...) Expand all Loading... |
24 class SequencedTaskRunner; | 24 class SequencedTaskRunner; |
25 } // namespace base | 25 } // namespace base |
26 | 26 |
27 namespace google_apis { | 27 namespace google_apis { |
28 class AboutResource; | 28 class AboutResource; |
29 class ResourceList; | 29 class ResourceList; |
30 } // namespace google_apis | 30 } // namespace google_apis |
31 | 31 |
32 namespace drive { | 32 namespace drive { |
33 | 33 |
34 class DirectoryFetchInfo; | |
35 class JobScheduler; | 34 class JobScheduler; |
36 class ResourceEntry; | 35 class ResourceEntry; |
37 | 36 |
38 namespace internal { | 37 namespace internal { |
39 | 38 |
40 class ChangeList; | 39 class ChangeList; |
41 class ChangeListLoaderObserver; | 40 class ChangeListLoaderObserver; |
42 class ChangeListProcessor; | 41 class ChangeListProcessor; |
| 42 class DirectoryFetchInfo; |
43 class ResourceMetadata; | 43 class ResourceMetadata; |
44 | 44 |
45 // Callback run as a response to SearchFromServer. | 45 // Callback run as a response to SearchFromServer. |
46 typedef base::Callback<void(ScopedVector<ChangeList> change_lists, | 46 typedef base::Callback<void(ScopedVector<ChangeList> change_lists, |
47 FileError error)> LoadChangeListCallback; | 47 FileError error)> LoadChangeListCallback; |
48 | 48 |
49 // ChangeListLoader is used to load the change list, the full resource list, | 49 // ChangeListLoader is used to load the change list, the full resource list, |
50 // and directory contents, from WAPI (codename for Documents List API) | 50 // and directory contents, from WAPI (codename for Documents List API) |
51 // or Google Drive API. The class also updates the resource metadata with | 51 // or Google Drive API. The class also updates the resource metadata with |
52 // the change list loaded from the server. | 52 // the change list loaded from the server. |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 void DoLoadDirectoryFromServerAfterLoad( | 203 void DoLoadDirectoryFromServerAfterLoad( |
204 const DirectoryFetchInfo& directory_fetch_info, | 204 const DirectoryFetchInfo& directory_fetch_info, |
205 const FileOperationCallback& callback, | 205 const FileOperationCallback& callback, |
206 ScopedVector<ChangeList> change_lists, | 206 ScopedVector<ChangeList> change_lists, |
207 FileError error); | 207 FileError error); |
208 | 208 |
209 // Part of DoLoadDirectoryFromServer(). | 209 // Part of DoLoadDirectoryFromServer(). |
210 void DoLoadDirectoryFromServerAfterRefresh( | 210 void DoLoadDirectoryFromServerAfterRefresh( |
211 const DirectoryFetchInfo& directory_fetch_info, | 211 const DirectoryFetchInfo& directory_fetch_info, |
212 const FileOperationCallback& callback, | 212 const FileOperationCallback& callback, |
213 FileError error, | 213 const base::FilePath* directory_path, |
214 const base::FilePath& directory_path); | 214 FileError error); |
215 | 215 |
216 // ================= Implementation for other stuff ================= | 216 // ================= Implementation for other stuff ================= |
217 | 217 |
218 // This function is used to handle pagenation for the result from | 218 // This function is used to handle pagenation for the result from |
219 // JobScheduler::GetChangeList/GetAllResourceList/ContinueGetResourceList/ | 219 // JobScheduler::GetChangeList/GetAllResourceList/ContinueGetResourceList/ |
220 // GetResourceListInDirectory(). | 220 // GetResourceListInDirectory(). |
221 // | 221 // |
222 // After all the change lists are fetched, |callback| will be invoked with | 222 // After all the change lists are fetched, |callback| will be invoked with |
223 // the collected change lists. | 223 // the collected change lists. |
224 void OnGetChangeList(ScopedVector<ChangeList> change_lists, | 224 void OnGetChangeList(ScopedVector<ChangeList> change_lists, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // Note: This should remain the last member so it'll be destroyed and | 268 // Note: This should remain the last member so it'll be destroyed and |
269 // invalidate its weak pointers before any other members are destroyed. | 269 // invalidate its weak pointers before any other members are destroyed. |
270 base::WeakPtrFactory<ChangeListLoader> weak_ptr_factory_; | 270 base::WeakPtrFactory<ChangeListLoader> weak_ptr_factory_; |
271 DISALLOW_COPY_AND_ASSIGN(ChangeListLoader); | 271 DISALLOW_COPY_AND_ASSIGN(ChangeListLoader); |
272 }; | 272 }; |
273 | 273 |
274 } // namespace internal | 274 } // namespace internal |
275 } // namespace drive | 275 } // namespace drive |
276 | 276 |
277 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ | 277 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ |
OLD | NEW |