Chromium Code Reviews| 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_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 // If |error| is not PLATFORM_FILE_OK, |directory_info| is set to NULL. | 71 // If |error| is not PLATFORM_FILE_OK, |directory_info| is set to NULL. |
| 72 typedef base::Callback<void(GDataFileError error, | 72 typedef base::Callback<void(GDataFileError error, |
| 73 bool hide_hosted_documents, | 73 bool hide_hosted_documents, |
| 74 scoped_ptr<GDataDirectoryProto> directory_proto)> | 74 scoped_ptr<GDataDirectoryProto> directory_proto)> |
| 75 ReadDirectoryCallback; | 75 ReadDirectoryCallback; |
| 76 | 76 |
| 77 // Used to get drive content search results. | 77 // Used to get drive content search results. |
| 78 // If |error| is not PLATFORM_FILE_OK, |result_paths| is empty. | 78 // If |error| is not PLATFORM_FILE_OK, |result_paths| is empty. |
| 79 typedef base::Callback<void( | 79 typedef base::Callback<void( |
| 80 GDataFileError error, | 80 GDataFileError error, |
| 81 const GURL& next_feed, | |
| 81 scoped_ptr<std::vector<SearchResultInfo> > result_paths)> SearchCallback; | 82 scoped_ptr<std::vector<SearchResultInfo> > result_paths)> SearchCallback; |
| 82 | 83 |
| 83 // Used to open files from the file system. |file_path| is the path on the local | 84 // Used to open files from the file system. |file_path| is the path on the local |
| 84 // file system for the opened file. | 85 // file system for the opened file. |
| 85 typedef base::Callback<void(GDataFileError error, | 86 typedef base::Callback<void(GDataFileError error, |
| 86 const FilePath& file_path)> OpenFileCallback; | 87 const FilePath& file_path)> OpenFileCallback; |
| 87 | 88 |
| 88 // Used to get available space for the account from GData. | 89 // Used to get available space for the account from GData. |
| 89 typedef base::Callback<void(GDataFileError error, | 90 typedef base::Callback<void(GDataFileError error, |
| 90 int64 bytes_total, | 91 int64 bytes_total, |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 // | 331 // |
| 331 // Can be called from UI/IO thread. | 332 // Can be called from UI/IO thread. |
| 332 virtual void RequestDirectoryRefresh(const FilePath& file_path) = 0; | 333 virtual void RequestDirectoryRefresh(const FilePath& file_path) = 0; |
| 333 | 334 |
| 334 // Does server side content search for |search_query|. | 335 // Does server side content search for |search_query|. |
| 335 // Search results will be returned as a list of results' |SearchResultInfo| | 336 // Search results will be returned as a list of results' |SearchResultInfo| |
| 336 // structs, which contains file's path and is_directory flag. | 337 // structs, which contains file's path and is_directory flag. |
| 337 // | 338 // |
| 338 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 339 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
| 339 virtual void Search(const std::string& search_query, | 340 virtual void Search(const std::string& search_query, |
| 341 const GURL& next_feed, | |
|
satorux1
2012/07/20 17:13:04
Please document next_feed in the function comment.
tbarzic
2012/07/20 17:51:43
Done.
| |
| 340 const SearchCallback& callback) = 0; | 342 const SearchCallback& callback) = 0; |
| 341 | 343 |
| 342 // Fetches the user's Account Metadata to find out current quota information | 344 // Fetches the user's Account Metadata to find out current quota information |
| 343 // and returns it to the callback. | 345 // and returns it to the callback. |
| 344 virtual void GetAvailableSpace(const GetAvailableSpaceCallback& callback) = 0; | 346 virtual void GetAvailableSpace(const GetAvailableSpaceCallback& callback) = 0; |
| 345 | 347 |
| 346 // Adds a file entry from |entry| under |virtual_dir_path|, and modifies | 348 // Adds a file entry from |entry| under |virtual_dir_path|, and modifies |
| 347 // the cache state. | 349 // the cache state. |
| 348 // | 350 // |
| 349 // When uploading a new file, adds a new file entry, and store its content | 351 // When uploading a new file, adds a new file entry, and store its content |
| 350 // from |file_content_path| into the cache. | 352 // from |file_content_path| into the cache. |
| 351 // | 353 // |
| 352 // When uploading an existing file, replaces the file entry with a new one, | 354 // When uploading an existing file, replaces the file entry with a new one, |
| 353 // and clears the dirty bit in the cache. | 355 // and clears the dirty bit in the cache. |
| 354 // | 356 // |
| 355 // |callback| will be called on the UI thread upon completion of operation. | 357 // |callback| will be called on the UI thread upon completion of operation. |
| 356 virtual void AddUploadedFile(UploadMode upload_mode, | 358 virtual void AddUploadedFile(UploadMode upload_mode, |
| 357 const FilePath& virtual_dir_path, | 359 const FilePath& virtual_dir_path, |
| 358 scoped_ptr<DocumentEntry> entry, | 360 scoped_ptr<DocumentEntry> entry, |
| 359 const FilePath& file_content_path, | 361 const FilePath& file_content_path, |
| 360 GDataCache::FileOperationType cache_operation, | 362 GDataCache::FileOperationType cache_operation, |
| 361 const base::Closure& callback) = 0; | 363 const base::Closure& callback) = 0; |
| 362 }; | 364 }; |
| 363 | 365 |
| 364 } // namespace gdata | 366 } // namespace gdata |
| 365 | 367 |
| 366 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 368 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
| OLD | NEW |