Chromium Code Reviews| Index: chrome/browser/chromeos/gdata/gdata_file_system.h |
| diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.h b/chrome/browser/chromeos/gdata/gdata_file_system.h |
| index c238e2f6edc9f5fedbbe1692536ac3cbef3d91f0..d4f5fd6c136bad03d7286f76a44e613d2128d2be 100644 |
| --- a/chrome/browser/chromeos/gdata/gdata_file_system.h |
| +++ b/chrome/browser/chromeos/gdata/gdata_file_system.h |
| @@ -71,6 +71,11 @@ typedef base::Callback<void(base::PlatformFileError error, |
| GDataFileType file_type)> |
| GetFileCallback; |
| +// Callback for SetMountedState. |
| +typedef base::Callback<void(base::PlatformFileError error, |
| + const FilePath& file_path)> |
| + SetMountedStateCallback; |
| + |
| // Used for file operations like removing files. |
| typedef base::Callback<void(base::PlatformFileError error, |
| base::ListValue* feed_list)> |
| @@ -183,6 +188,7 @@ class GDataFileSystemInterface { |
| enum CachedFileOrigin { |
| CACHED_FILE_FROM_SERVER = 0, |
| CACHED_FILE_LOCALLY_MODIFIED, |
| + CACHED_FILE_MOUNTED, |
| }; |
| // Enum defining type of file operation e.g. copy or move, etc. |
| @@ -356,6 +362,10 @@ class GDataFileSystemInterface { |
| virtual bool GetFileInfoFromPath(const FilePath& gdata_file_path, |
| GDataFileProperties* properties) = 0; |
| + // Returns true if the given path is under gdata cache directory, i.e. |
| + // <user_profile_dir>/GCache/v1 |
| + virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const = 0; |
| + |
| // Returns the tmp sub-directory under gdata cache directory, i.e. |
| // <user_profile_dir>/GCache/v1/tmp |
| virtual FilePath GetGDataCacheTmpDirectory() const = 0; |
| @@ -391,6 +401,12 @@ class GDataFileSystemInterface { |
| virtual void SetPinState(const FilePath& file_path, bool to_pin, |
| const FileOperationCallback& callback) = 0; |
| + // Mark or unmark a file as locally mounted. |
| + // When marked as mounted, the file is prevented from being modified |
| + // or evicted from cache. |
|
kuan
2012/04/18 00:43:50
marking it as mounted doesn't automatically preven
|
| + virtual void SetMountedState(const FilePath& file_path, bool to_mount, |
| + const SetMountedStateCallback& callback) = 0; |
| + |
| // Creates a new file from |entry| under |virtual_dir_path|. Stored its |
| // content from |file_content_path| into the cache. |
| virtual void AddUploadedFile(const FilePath& virtual_dir_path, |
| @@ -457,6 +473,7 @@ class GDataFileSystem : public GDataFileSystemInterface, |
| const GetCacheStateCallback& callback) OVERRIDE; |
| virtual bool GetFileInfoFromPath(const FilePath& gdata_file_path, |
| GDataFileProperties* properties) OVERRIDE; |
| + virtual bool IsUnderGDataCacheDirectory(const FilePath& path) const OVERRIDE; |
| virtual FilePath GetGDataCacheTmpDirectory() const OVERRIDE; |
| virtual FilePath GetGDataTempDownloadFolderPath() const OVERRIDE; |
| virtual FilePath GetGDataTempDocumentFolderPath() const OVERRIDE; |
| @@ -472,6 +489,9 @@ class GDataFileSystem : public GDataFileSystemInterface, |
| // Calls private Pin or Unpin methods with |callback|. |
| virtual void SetPinState(const FilePath& file_path, bool pin, |
| const FileOperationCallback& callback) OVERRIDE; |
| + virtual void SetMountedState( |
| + const FilePath& file_path, bool to_mount, |
| + const SetMountedStateCallback& callback) OVERRIDE; |
|
kuan
2012/04/18 00:36:36
nit: either align all parameters after (, or 4-spa
|
| virtual void AddUploadedFile(const FilePath& virtual_dir_path, |
| DocumentEntry* entry, |
| const FilePath& file_content_path, |