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 <utility> | 10 #include <utility> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Note that This function initiates the loading without comparing the | 75 // Note that This function initiates the loading without comparing the |
76 // directory changestamp against the server changestamp. The primary | 76 // directory changestamp against the server changestamp. The primary |
77 // purpose of this function is to update parts of entries in the directory | 77 // purpose of this function is to update parts of entries in the directory |
78 // which can stale over time, such as thumbnail URLs. | 78 // which can stale over time, such as thumbnail URLs. |
79 void LoadDirectoryFromServer(const std::string& directory_resource_id, | 79 void LoadDirectoryFromServer(const std::string& directory_resource_id, |
80 const FileOperationCallback& callback); | 80 const FileOperationCallback& callback); |
81 | 81 |
82 // Starts retrieving search results for |search_query| from the server. | 82 // Starts retrieving search results for |search_query| from the server. |
83 // If |next_feed| is set, this is the feed url that will be fetched. | 83 // If |next_feed| is set, this is the feed url that will be fetched. |
84 // If |next_feed| is an empty string, the default URL is used. | 84 // If |next_feed| is an empty string, the default URL is used. |
85 // Upon completion, |feed_load_callback| is invoked. | 85 // Upon completion, |callback| is invoked. |
86 // |feed_load_callback| must not be null. | 86 // |callback| must not be null. |
87 void SearchFromServer(const std::string& search_query, | 87 void SearchFromServer(const std::string& search_query, |
88 const GURL& next_feed, | 88 const GURL& next_feed, |
89 const LoadFeedListCallback& feed_load_callback); | 89 const LoadFeedListCallback& callback); |
90 | 90 |
91 // Initiates the change list loading from the server if the local | 91 // Initiates the change list loading from the server if the local |
92 // changestamp is older than the server changestamp. | 92 // changestamp is older than the server changestamp. |
93 // See the comment at Load() for |directory_fetch_info| parameter. | 93 // See the comment at Load() for |directory_fetch_info| parameter. |
94 // |callback| must not be null. | 94 // |callback| must not be null. |
95 // TODO(satorux): make this private. crbug.com/193417 | 95 // TODO(satorux): make this private. crbug.com/193417 |
96 void LoadFromServerIfNeeded(const DirectoryFetchInfo& directory_fetch_info, | 96 void LoadFromServerIfNeeded(const DirectoryFetchInfo& directory_fetch_info, |
97 const FileOperationCallback& callback); | 97 const FileOperationCallback& callback); |
98 | 98 |
99 // Updates whole directory structure feeds collected in |feed_list|. | 99 // Updates whole directory structure feeds collected in |feed_list|. |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 int64 start_changestamp, | 224 int64 start_changestamp, |
225 const FileOperationCallback& callback, | 225 const FileOperationCallback& callback, |
226 DriveFileError error); | 226 DriveFileError error); |
227 | 227 |
228 // Callback for handling response from |DriveAPIService::GetAppList|. | 228 // Callback for handling response from |DriveAPIService::GetAppList|. |
229 // If the application list is successfully parsed, passes the list to | 229 // If the application list is successfully parsed, passes the list to |
230 // Drive webapps registry. | 230 // Drive webapps registry. |
231 void OnGetAppList(google_apis::GDataErrorCode status, | 231 void OnGetAppList(google_apis::GDataErrorCode status, |
232 scoped_ptr<google_apis::AppList> app_list); | 232 scoped_ptr<google_apis::AppList> app_list); |
233 | 233 |
| 234 // Part of SearchFromServer. Called when ResourceList is fetched from the |
| 235 // server. |
| 236 // |callback| must not be null. |
| 237 void SearchFromServerAfterGetResourceList( |
| 238 const LoadFeedListCallback& callback, |
| 239 google_apis::GDataErrorCode status, |
| 240 scoped_ptr<google_apis::ResourceList> resource_list); |
| 241 |
234 // Callback for handling feed content fetching while searching for file info. | 242 // Callback for handling feed content fetching while searching for file info. |
235 // This callback is invoked after async feed fetch operation that was | 243 // This callback is invoked after async feed fetch operation that was |
236 // invoked by StartDirectoryRefresh() completes. This callback will update | 244 // invoked by StartDirectoryRefresh() completes. This callback will update |
237 // the content of the refreshed directory object and continue initially | 245 // the content of the refreshed directory object and continue initially |
238 // started FindEntryByPath() request. | 246 // started FindEntryByPath() request. |
239 void UpdateMetadataFromFeedAfterLoadFromServer( | 247 void UpdateMetadataFromFeedAfterLoadFromServer( |
240 scoped_ptr<google_apis::AboutResource> about_resource, | 248 scoped_ptr<google_apis::AboutResource> about_resource, |
241 bool is_delta_feed, | 249 bool is_delta_feed, |
242 const FileOperationCallback& callback, | 250 const FileOperationCallback& callback, |
243 ScopedVector<ChangeList> change_lists, | 251 ScopedVector<ChangeList> change_lists, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 312 |
305 // Note: This should remain the last member so it'll be destroyed and | 313 // Note: This should remain the last member so it'll be destroyed and |
306 // invalidate its weak pointers before any other members are destroyed. | 314 // invalidate its weak pointers before any other members are destroyed. |
307 base::WeakPtrFactory<ChangeListLoader> weak_ptr_factory_; | 315 base::WeakPtrFactory<ChangeListLoader> weak_ptr_factory_; |
308 DISALLOW_COPY_AND_ASSIGN(ChangeListLoader); | 316 DISALLOW_COPY_AND_ASSIGN(ChangeListLoader); |
309 }; | 317 }; |
310 | 318 |
311 } // namespace drive | 319 } // namespace drive |
312 | 320 |
313 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ | 321 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_CHANGE_LIST_LOADER_H_ |
OLD | NEW |