| 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_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
| 10 | 10 |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 // otherwise. | 350 // otherwise. |
| 351 virtual void GetCacheState(const std::string& resource_id, | 351 virtual void GetCacheState(const std::string& resource_id, |
| 352 const std::string& md5, | 352 const std::string& md5, |
| 353 const GetCacheStateCallback& callback) = 0; | 353 const GetCacheStateCallback& callback) = 0; |
| 354 | 354 |
| 355 // Finds a file (not a directory) by |file_path| and returns its key | 355 // Finds a file (not a directory) by |file_path| and returns its key |
| 356 // |properties|. Returns true if file was found. | 356 // |properties|. Returns true if file was found. |
| 357 virtual bool GetFileInfoByPath(const FilePath& gdata_file_path, | 357 virtual bool GetFileInfoByPath(const FilePath& gdata_file_path, |
| 358 GDataFileProperties* properties) = 0; | 358 GDataFileProperties* properties) = 0; |
| 359 | 359 |
| 360 // Returns the tmp sub-directory under gdata cache directory, i.e. | 360 // Returns the sub-directory under gdata cache directory for the given sub |
| 361 // <user_profile_dir>/GCache/v1/tmp | 361 // directory type. Example: <user_profile_dir>/GCache/v1/tmp |
| 362 virtual FilePath GetGDataCacheTmpDirectory() const = 0; | 362 virtual FilePath GetCacheDirectoryPath( |
| 363 | 363 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const = 0; |
| 364 // Returns the tmp downloads sub-directory under gdata cache directory, i.e. | |
| 365 // <user_profile_dir>/GCache/v1/tmp/downloads/ | |
| 366 virtual FilePath GetGDataTempDownloadFolderPath() const = 0; | |
| 367 | |
| 368 // Returns the tmp documents sub-directory under gdata cache directory, i.e. | |
| 369 // <user_profile_dir>/GCache/v1/tmp/documents/ | |
| 370 virtual FilePath GetGDataTempDocumentFolderPath() const = 0; | |
| 371 | |
| 372 // Returns the pinned sub-directory under gdata cache directory, i.e. | |
| 373 // <user_profile_dir>/GCache/v1/pinned | |
| 374 virtual FilePath GetGDataCachePinnedDirectory() const = 0; | |
| 375 | |
| 376 // Returns the pinned sub-directory under gdata cache directory, i.e. | |
| 377 // <user_profile_dir>/GCache/v1/pinned | |
| 378 virtual FilePath GetGDataCachePersistentDirectory() const = 0; | |
| 379 | 364 |
| 380 // Returns absolute path of the file if it were cached or to be cached. | 365 // Returns absolute path of the file if it were cached or to be cached. |
| 381 virtual FilePath GetCacheFilePath( | 366 virtual FilePath GetCacheFilePath( |
| 382 const std::string& resource_id, | 367 const std::string& resource_id, |
| 383 const std::string& md5, | 368 const std::string& md5, |
| 384 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, | 369 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, |
| 385 CachedFileOrigin file_orign) const = 0; | 370 CachedFileOrigin file_orign) const = 0; |
| 386 | 371 |
| 387 // Fetches the user's Account Metadata to find out current quota information | 372 // Fetches the user's Account Metadata to find out current quota information |
| 388 // and returns it to the callback. | 373 // and returns it to the callback. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 virtual bool CancelOperation(const FilePath& file_path) OVERRIDE; | 433 virtual bool CancelOperation(const FilePath& file_path) OVERRIDE; |
| 449 virtual void AddOperationObserver( | 434 virtual void AddOperationObserver( |
| 450 GDataOperationRegistry::Observer* observer) OVERRIDE; | 435 GDataOperationRegistry::Observer* observer) OVERRIDE; |
| 451 virtual void RemoveOperationObserver( | 436 virtual void RemoveOperationObserver( |
| 452 GDataOperationRegistry::Observer* observer) OVERRIDE; | 437 GDataOperationRegistry::Observer* observer) OVERRIDE; |
| 453 virtual void GetCacheState(const std::string& resource_id, | 438 virtual void GetCacheState(const std::string& resource_id, |
| 454 const std::string& md5, | 439 const std::string& md5, |
| 455 const GetCacheStateCallback& callback) OVERRIDE; | 440 const GetCacheStateCallback& callback) OVERRIDE; |
| 456 virtual bool GetFileInfoByPath(const FilePath& gdata_file_path, | 441 virtual bool GetFileInfoByPath(const FilePath& gdata_file_path, |
| 457 GDataFileProperties* properties) OVERRIDE; | 442 GDataFileProperties* properties) OVERRIDE; |
| 458 virtual FilePath GetGDataCacheTmpDirectory() const OVERRIDE; | 443 virtual FilePath GetCacheDirectoryPath( |
| 459 virtual FilePath GetGDataTempDownloadFolderPath() const OVERRIDE; | 444 GDataRootDirectory::CacheSubDirectoryType sub_dir_type) const OVERRIDE; |
| 460 virtual FilePath GetGDataTempDocumentFolderPath() const OVERRIDE; | |
| 461 virtual FilePath GetGDataCachePinnedDirectory() const OVERRIDE; | |
| 462 virtual FilePath GetGDataCachePersistentDirectory() const OVERRIDE; | |
| 463 virtual FilePath GetCacheFilePath( | 445 virtual FilePath GetCacheFilePath( |
| 464 const std::string& resource_id, | 446 const std::string& resource_id, |
| 465 const std::string& md5, | 447 const std::string& md5, |
| 466 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, | 448 GDataRootDirectory::CacheSubDirectoryType sub_dir_type, |
| 467 CachedFileOrigin file_orign) const OVERRIDE; | 449 CachedFileOrigin file_orign) const OVERRIDE; |
| 468 virtual void GetAvailableSpace( | 450 virtual void GetAvailableSpace( |
| 469 const GetAvailableSpaceCallback& callback) OVERRIDE; | 451 const GetAvailableSpaceCallback& callback) OVERRIDE; |
| 470 // Calls private Pin or Unpin methods with |callback|. | 452 // Calls private Pin or Unpin methods with |callback|. |
| 471 virtual void SetPinState(const FilePath& file_path, bool pin, | 453 virtual void SetPinState(const FilePath& file_path, bool pin, |
| 472 const FileOperationCallback& callback) OVERRIDE; | 454 const FileOperationCallback& callback) OVERRIDE; |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 }; | 1328 }; |
| 1347 | 1329 |
| 1348 // Sets the free disk space getter for testing. | 1330 // Sets the free disk space getter for testing. |
| 1349 // The existing getter is deleted. | 1331 // The existing getter is deleted. |
| 1350 void SetFreeDiskSpaceGetterForTesting( | 1332 void SetFreeDiskSpaceGetterForTesting( |
| 1351 FreeDiskSpaceGetterInterface* getter); | 1333 FreeDiskSpaceGetterInterface* getter); |
| 1352 | 1334 |
| 1353 } // namespace gdata | 1335 } // namespace gdata |
| 1354 | 1336 |
| 1355 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1337 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| OLD | NEW |