| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 typedef std::vector<GDataEntryProto> GDataEntryProtoVector; | 63 typedef std::vector<GDataEntryProto> GDataEntryProtoVector; |
| 64 typedef base::Callback<void(GDataFileError error, | 64 typedef base::Callback<void(GDataFileError error, |
| 65 bool hide_hosted_documents, | 65 bool hide_hosted_documents, |
| 66 scoped_ptr<GDataEntryProtoVector> entries)> | 66 scoped_ptr<GDataEntryProtoVector> entries)> |
| 67 ReadDirectoryCallback; | 67 ReadDirectoryCallback; |
| 68 | 68 |
| 69 // Used to get drive content search results. | 69 // Used to get drive content search results. |
| 70 // If |error| is not PLATFORM_FILE_OK, |result_paths| is empty. | 70 // If |error| is not PLATFORM_FILE_OK, |result_paths| is empty. |
| 71 typedef base::Callback<void( | 71 typedef base::Callback<void( |
| 72 GDataFileError error, | 72 GDataFileError error, |
| 73 const GURL& next_feed, |
| 73 scoped_ptr<std::vector<SearchResultInfo> > result_paths)> SearchCallback; | 74 scoped_ptr<std::vector<SearchResultInfo> > result_paths)> SearchCallback; |
| 74 | 75 |
| 75 // Used to open files from the file system. |file_path| is the path on the local | 76 // Used to open files from the file system. |file_path| is the path on the local |
| 76 // file system for the opened file. | 77 // file system for the opened file. |
| 77 typedef base::Callback<void(GDataFileError error, | 78 typedef base::Callback<void(GDataFileError error, |
| 78 const FilePath& file_path)> OpenFileCallback; | 79 const FilePath& file_path)> OpenFileCallback; |
| 79 | 80 |
| 80 // Used to get available space for the account from GData. | 81 // Used to get available space for the account from GData. |
| 81 typedef base::Callback<void(GDataFileError error, | 82 typedef base::Callback<void(GDataFileError error, |
| 82 int64 bytes_total, | 83 int64 bytes_total, |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // | 321 // |
| 321 // Upon success, the metadata of files in the target directory is updated, | 322 // Upon success, the metadata of files in the target directory is updated, |
| 322 // and the change is notified via Observer::OnDirectoryChanged(). Note that | 323 // and the change is notified via Observer::OnDirectoryChanged(). Note that |
| 323 // this function ignores changes in directories in the target | 324 // this function ignores changes in directories in the target |
| 324 // directory. Changes in directories are handled via the delta feeds. | 325 // directory. Changes in directories are handled via the delta feeds. |
| 325 // | 326 // |
| 326 // Can be called from UI/IO thread. | 327 // Can be called from UI/IO thread. |
| 327 virtual void RequestDirectoryRefresh(const FilePath& file_path) = 0; | 328 virtual void RequestDirectoryRefresh(const FilePath& file_path) = 0; |
| 328 | 329 |
| 329 // Does server side content search for |search_query|. | 330 // Does server side content search for |search_query|. |
| 331 // If |next_feed| is set, this is the feed url that will be fetched. |
| 330 // Search results will be returned as a list of results' |SearchResultInfo| | 332 // Search results will be returned as a list of results' |SearchResultInfo| |
| 331 // structs, which contains file's path and is_directory flag. | 333 // structs, which contains file's path and is_directory flag. |
| 332 // | 334 // |
| 333 // Can be called from UI/IO thread. |callback| is run on the calling thread. | 335 // Can be called from UI/IO thread. |callback| is run on the calling thread. |
| 334 virtual void Search(const std::string& search_query, | 336 virtual void Search(const std::string& search_query, |
| 337 const GURL& next_feed, |
| 335 const SearchCallback& callback) = 0; | 338 const SearchCallback& callback) = 0; |
| 336 | 339 |
| 337 // Fetches the user's Account Metadata to find out current quota information | 340 // Fetches the user's Account Metadata to find out current quota information |
| 338 // and returns it to the callback. | 341 // and returns it to the callback. |
| 339 virtual void GetAvailableSpace(const GetAvailableSpaceCallback& callback) = 0; | 342 virtual void GetAvailableSpace(const GetAvailableSpaceCallback& callback) = 0; |
| 340 | 343 |
| 341 // Adds a file entry from |entry| under |virtual_dir_path|, and modifies | 344 // Adds a file entry from |entry| under |virtual_dir_path|, and modifies |
| 342 // the cache state. | 345 // the cache state. |
| 343 // | 346 // |
| 344 // When uploading a new file, adds a new file entry, and store its content | 347 // When uploading a new file, adds a new file entry, and store its content |
| 345 // from |file_content_path| into the cache. | 348 // from |file_content_path| into the cache. |
| 346 // | 349 // |
| 347 // When uploading an existing file, replaces the file entry with a new one, | 350 // When uploading an existing file, replaces the file entry with a new one, |
| 348 // and clears the dirty bit in the cache. | 351 // and clears the dirty bit in the cache. |
| 349 // | 352 // |
| 350 // |callback| will be called on the UI thread upon completion of operation. | 353 // |callback| will be called on the UI thread upon completion of operation. |
| 351 virtual void AddUploadedFile(UploadMode upload_mode, | 354 virtual void AddUploadedFile(UploadMode upload_mode, |
| 352 const FilePath& virtual_dir_path, | 355 const FilePath& virtual_dir_path, |
| 353 scoped_ptr<DocumentEntry> entry, | 356 scoped_ptr<DocumentEntry> entry, |
| 354 const FilePath& file_content_path, | 357 const FilePath& file_content_path, |
| 355 GDataCache::FileOperationType cache_operation, | 358 GDataCache::FileOperationType cache_operation, |
| 356 const base::Closure& callback) = 0; | 359 const base::Closure& callback) = 0; |
| 357 }; | 360 }; |
| 358 | 361 |
| 359 } // namespace gdata | 362 } // namespace gdata |
| 360 | 363 |
| 361 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ | 364 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_INTERFACE_H_ |
| OLD | NEW |