| 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_FILE_SYSTEM_INTERFACE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_INTERFACE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_INTERFACE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 // |callback| must not be null. | 311 // |callback| must not be null. |
| 312 virtual void Pin(const base::FilePath& file_path, | 312 virtual void Pin(const base::FilePath& file_path, |
| 313 const FileOperationCallback& callback) = 0; | 313 const FileOperationCallback& callback) = 0; |
| 314 | 314 |
| 315 // Unpins a file at |file_path|. | 315 // Unpins a file at |file_path|. |
| 316 // | 316 // |
| 317 // |callback| must not be null. | 317 // |callback| must not be null. |
| 318 virtual void Unpin(const base::FilePath& file_path, | 318 virtual void Unpin(const base::FilePath& file_path, |
| 319 const FileOperationCallback& callback) = 0; | 319 const FileOperationCallback& callback) = 0; |
| 320 | 320 |
| 321 // Gets |file_path| from the file system. The file entry represented by | 321 // Makes sure that |file_path| in the file system is available in the local |
| 322 // |file_path| needs to be present in in-memory representation of the file | 322 // cache. If the file is not cached, the file will be downloaded. The entry |
| 323 // system in order to be retrieved. If the file is not cached, the file | 323 // needs to be present in the file system. |
| 324 // will be downloaded through GData API or Drive V2 API. | |
| 325 // | 324 // |
| 326 // |callback| must not be null. | 325 // Returns the cache path and entry info to |callback|. It must not be null. |
| 327 virtual void GetFileByPath(const base::FilePath& file_path, | 326 virtual void GetFileByPath(const base::FilePath& file_path, |
| 328 const GetFileCallback& callback) = 0; | 327 const GetFileCallback& callback) = 0; |
| 329 | 328 |
| 329 // Makes sure that |file_path| in the file system is available in the local |
| 330 // cache, and mark it as dirty. The next modification to the cache file is |
| 331 // watched and is automatically uploaded to the server. If the entry is not |
| 332 // present in the file system, it is created. |
| 333 // |
| 334 // Returns the cache path and entry info to |callback|. It must not be null. |
| 335 virtual void GetFileByPathForSaving(const base::FilePath& file_path, |
| 336 const GetFileCallback& callback) = 0; |
| 337 |
| 330 // Gets a file by the given |file_path|. | 338 // Gets a file by the given |file_path|. |
| 331 // Calls |initialized_callback| when either: | 339 // Calls |initialized_callback| when either: |
| 332 // 1) The cached file (or JSON file for hosted file) is found, or | 340 // 1) The cached file (or JSON file for hosted file) is found, or |
| 333 // 2) Starting to download the file from drive server. | 341 // 2) Starting to download the file from drive server. |
| 334 // In case of 2), the given FilePath is empty, and |get_content_callback| is | 342 // In case of 2), the given FilePath is empty, and |get_content_callback| is |
| 335 // called repeatedly with downloaded content following the | 343 // called repeatedly with downloaded content following the |
| 336 // |initialized_callback| invocation. | 344 // |initialized_callback| invocation. |
| 337 // |completion_callback| is invoked if an error is found, or the operation | 345 // |completion_callback| is invoked if an error is found, or the operation |
| 338 // is successfully done. | 346 // is successfully done. |
| 339 // |initialized_callback|, |get_content_callback| and |completion_callback| | 347 // |initialized_callback|, |get_content_callback| and |completion_callback| |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 const std::string& resource_id, | 428 const std::string& resource_id, |
| 421 const GetCacheEntryCallback& callback) = 0; | 429 const GetCacheEntryCallback& callback) = 0; |
| 422 | 430 |
| 423 // Reloads the resource metadata from the server. | 431 // Reloads the resource metadata from the server. |
| 424 virtual void Reload() = 0; | 432 virtual void Reload() = 0; |
| 425 }; | 433 }; |
| 426 | 434 |
| 427 } // namespace drive | 435 } // namespace drive |
| 428 | 436 |
| 429 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_INTERFACE_H_ | 437 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_INTERFACE_H_ |
| OLD | NEW |