| 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_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 EventLogger* logger, | 68 EventLogger* logger, |
| 69 internal::FileCache* cache, | 69 internal::FileCache* cache, |
| 70 DriveServiceInterface* drive_service, | 70 DriveServiceInterface* drive_service, |
| 71 JobScheduler* scheduler, | 71 JobScheduler* scheduler, |
| 72 internal::ResourceMetadata* resource_metadata, | 72 internal::ResourceMetadata* resource_metadata, |
| 73 base::SequencedTaskRunner* blocking_task_runner, | 73 base::SequencedTaskRunner* blocking_task_runner, |
| 74 const base::FilePath& temporary_file_directory); | 74 const base::FilePath& temporary_file_directory); |
| 75 virtual ~FileSystem(); | 75 virtual ~FileSystem(); |
| 76 | 76 |
| 77 // FileSystemInterface overrides. | 77 // FileSystemInterface overrides. |
| 78 virtual void AddObserver(FileSystemObserver* observer) OVERRIDE; | 78 virtual void AddObserver(FileSystemObserver* observer) override; |
| 79 virtual void RemoveObserver(FileSystemObserver* observer) OVERRIDE; | 79 virtual void RemoveObserver(FileSystemObserver* observer) override; |
| 80 virtual void CheckForUpdates() OVERRIDE; | 80 virtual void CheckForUpdates() override; |
| 81 virtual void Search(const std::string& search_query, | 81 virtual void Search(const std::string& search_query, |
| 82 const GURL& next_link, | 82 const GURL& next_link, |
| 83 const SearchCallback& callback) OVERRIDE; | 83 const SearchCallback& callback) override; |
| 84 virtual void SearchMetadata(const std::string& query, | 84 virtual void SearchMetadata(const std::string& query, |
| 85 int options, | 85 int options, |
| 86 int at_most_num_matches, | 86 int at_most_num_matches, |
| 87 const SearchMetadataCallback& callback) OVERRIDE; | 87 const SearchMetadataCallback& callback) override; |
| 88 virtual void TransferFileFromLocalToRemote( | 88 virtual void TransferFileFromLocalToRemote( |
| 89 const base::FilePath& local_src_file_path, | 89 const base::FilePath& local_src_file_path, |
| 90 const base::FilePath& remote_dest_file_path, | 90 const base::FilePath& remote_dest_file_path, |
| 91 const FileOperationCallback& callback) OVERRIDE; | 91 const FileOperationCallback& callback) override; |
| 92 virtual void OpenFile(const base::FilePath& file_path, | 92 virtual void OpenFile(const base::FilePath& file_path, |
| 93 OpenMode open_mode, | 93 OpenMode open_mode, |
| 94 const std::string& mime_type, | 94 const std::string& mime_type, |
| 95 const OpenFileCallback& callback) OVERRIDE; | 95 const OpenFileCallback& callback) override; |
| 96 virtual void Copy(const base::FilePath& src_file_path, | 96 virtual void Copy(const base::FilePath& src_file_path, |
| 97 const base::FilePath& dest_file_path, | 97 const base::FilePath& dest_file_path, |
| 98 bool preserve_last_modified, | 98 bool preserve_last_modified, |
| 99 const FileOperationCallback& callback) OVERRIDE; | 99 const FileOperationCallback& callback) override; |
| 100 virtual void Move(const base::FilePath& src_file_path, | 100 virtual void Move(const base::FilePath& src_file_path, |
| 101 const base::FilePath& dest_file_path, | 101 const base::FilePath& dest_file_path, |
| 102 const FileOperationCallback& callback) OVERRIDE; | 102 const FileOperationCallback& callback) override; |
| 103 virtual void Remove(const base::FilePath& file_path, | 103 virtual void Remove(const base::FilePath& file_path, |
| 104 bool is_recursive, | 104 bool is_recursive, |
| 105 const FileOperationCallback& callback) OVERRIDE; | 105 const FileOperationCallback& callback) override; |
| 106 virtual void CreateDirectory(const base::FilePath& directory_path, | 106 virtual void CreateDirectory(const base::FilePath& directory_path, |
| 107 bool is_exclusive, | 107 bool is_exclusive, |
| 108 bool is_recursive, | 108 bool is_recursive, |
| 109 const FileOperationCallback& callback) OVERRIDE; | 109 const FileOperationCallback& callback) override; |
| 110 virtual void CreateFile(const base::FilePath& file_path, | 110 virtual void CreateFile(const base::FilePath& file_path, |
| 111 bool is_exclusive, | 111 bool is_exclusive, |
| 112 const std::string& mime_type, | 112 const std::string& mime_type, |
| 113 const FileOperationCallback& callback) OVERRIDE; | 113 const FileOperationCallback& callback) override; |
| 114 virtual void TouchFile(const base::FilePath& file_path, | 114 virtual void TouchFile(const base::FilePath& file_path, |
| 115 const base::Time& last_access_time, | 115 const base::Time& last_access_time, |
| 116 const base::Time& last_modified_time, | 116 const base::Time& last_modified_time, |
| 117 const FileOperationCallback& callback) OVERRIDE; | 117 const FileOperationCallback& callback) override; |
| 118 virtual void TruncateFile(const base::FilePath& file_path, | 118 virtual void TruncateFile(const base::FilePath& file_path, |
| 119 int64 length, | 119 int64 length, |
| 120 const FileOperationCallback& callback) OVERRIDE; | 120 const FileOperationCallback& callback) override; |
| 121 virtual void Pin(const base::FilePath& file_path, | 121 virtual void Pin(const base::FilePath& file_path, |
| 122 const FileOperationCallback& callback) OVERRIDE; | 122 const FileOperationCallback& callback) override; |
| 123 virtual void Unpin(const base::FilePath& file_path, | 123 virtual void Unpin(const base::FilePath& file_path, |
| 124 const FileOperationCallback& callback) OVERRIDE; | 124 const FileOperationCallback& callback) override; |
| 125 virtual void GetFile(const base::FilePath& file_path, | 125 virtual void GetFile(const base::FilePath& file_path, |
| 126 const GetFileCallback& callback) OVERRIDE; | 126 const GetFileCallback& callback) override; |
| 127 virtual void GetFileForSaving(const base::FilePath& file_path, | 127 virtual void GetFileForSaving(const base::FilePath& file_path, |
| 128 const GetFileCallback& callback) OVERRIDE; | 128 const GetFileCallback& callback) override; |
| 129 virtual base::Closure GetFileContent( | 129 virtual base::Closure GetFileContent( |
| 130 const base::FilePath& file_path, | 130 const base::FilePath& file_path, |
| 131 const GetFileContentInitializedCallback& initialized_callback, | 131 const GetFileContentInitializedCallback& initialized_callback, |
| 132 const google_apis::GetContentCallback& get_content_callback, | 132 const google_apis::GetContentCallback& get_content_callback, |
| 133 const FileOperationCallback& completion_callback) OVERRIDE; | 133 const FileOperationCallback& completion_callback) override; |
| 134 virtual void GetResourceEntry( | 134 virtual void GetResourceEntry( |
| 135 const base::FilePath& file_path, | 135 const base::FilePath& file_path, |
| 136 const GetResourceEntryCallback& callback) OVERRIDE; | 136 const GetResourceEntryCallback& callback) override; |
| 137 virtual void ReadDirectory( | 137 virtual void ReadDirectory( |
| 138 const base::FilePath& directory_path, | 138 const base::FilePath& directory_path, |
| 139 const ReadDirectoryEntriesCallback& entries_callback, | 139 const ReadDirectoryEntriesCallback& entries_callback, |
| 140 const FileOperationCallback& completion_callback) OVERRIDE; | 140 const FileOperationCallback& completion_callback) override; |
| 141 virtual void GetAvailableSpace( | 141 virtual void GetAvailableSpace( |
| 142 const GetAvailableSpaceCallback& callback) OVERRIDE; | 142 const GetAvailableSpaceCallback& callback) override; |
| 143 virtual void GetShareUrl( | 143 virtual void GetShareUrl( |
| 144 const base::FilePath& file_path, | 144 const base::FilePath& file_path, |
| 145 const GURL& embed_origin, | 145 const GURL& embed_origin, |
| 146 const GetShareUrlCallback& callback) OVERRIDE; | 146 const GetShareUrlCallback& callback) override; |
| 147 virtual void GetMetadata( | 147 virtual void GetMetadata( |
| 148 const GetFilesystemMetadataCallback& callback) OVERRIDE; | 148 const GetFilesystemMetadataCallback& callback) override; |
| 149 virtual void MarkCacheFileAsMounted( | 149 virtual void MarkCacheFileAsMounted( |
| 150 const base::FilePath& drive_file_path, | 150 const base::FilePath& drive_file_path, |
| 151 const MarkMountedCallback& callback) OVERRIDE; | 151 const MarkMountedCallback& callback) override; |
| 152 virtual void MarkCacheFileAsUnmounted( | 152 virtual void MarkCacheFileAsUnmounted( |
| 153 const base::FilePath& cache_file_path, | 153 const base::FilePath& cache_file_path, |
| 154 const FileOperationCallback& callback) OVERRIDE; | 154 const FileOperationCallback& callback) override; |
| 155 virtual void AddPermission(const base::FilePath& drive_file_path, | 155 virtual void AddPermission(const base::FilePath& drive_file_path, |
| 156 const std::string& email, | 156 const std::string& email, |
| 157 google_apis::drive::PermissionRole role, | 157 google_apis::drive::PermissionRole role, |
| 158 const FileOperationCallback& callback) OVERRIDE; | 158 const FileOperationCallback& callback) override; |
| 159 virtual void Reset(const FileOperationCallback& callback) OVERRIDE; | 159 virtual void Reset(const FileOperationCallback& callback) override; |
| 160 virtual void GetPathFromResourceId(const std::string& resource_id, | 160 virtual void GetPathFromResourceId(const std::string& resource_id, |
| 161 const GetFilePathCallback& callback) | 161 const GetFilePathCallback& callback) |
| 162 OVERRIDE; | 162 override; |
| 163 | 163 |
| 164 // file_system::OperationDelegate overrides. | 164 // file_system::OperationDelegate overrides. |
| 165 virtual void OnFileChangedByOperation( | 165 virtual void OnFileChangedByOperation( |
| 166 const FileChange& changed_files) OVERRIDE; | 166 const FileChange& changed_files) override; |
| 167 virtual void OnEntryUpdatedByOperation(const std::string& local_id) OVERRIDE; | 167 virtual void OnEntryUpdatedByOperation(const std::string& local_id) override; |
| 168 virtual void OnDriveSyncError(file_system::DriveSyncErrorType type, | 168 virtual void OnDriveSyncError(file_system::DriveSyncErrorType type, |
| 169 const std::string& local_id) OVERRIDE; | 169 const std::string& local_id) override; |
| 170 virtual bool WaitForSyncComplete( | 170 virtual bool WaitForSyncComplete( |
| 171 const std::string& local_id, | 171 const std::string& local_id, |
| 172 const FileOperationCallback& callback) OVERRIDE; | 172 const FileOperationCallback& callback) override; |
| 173 | 173 |
| 174 // ChangeListLoader::Observer overrides. | 174 // ChangeListLoader::Observer overrides. |
| 175 // Used to propagate events from ChangeListLoader. | 175 // Used to propagate events from ChangeListLoader. |
| 176 virtual void OnDirectoryReloaded( | 176 virtual void OnDirectoryReloaded( |
| 177 const base::FilePath& directory_path) OVERRIDE; | 177 const base::FilePath& directory_path) override; |
| 178 virtual void OnFileChanged(const FileChange& changed_files) OVERRIDE; | 178 virtual void OnFileChanged(const FileChange& changed_files) override; |
| 179 virtual void OnLoadFromServerComplete() OVERRIDE; | 179 virtual void OnLoadFromServerComplete() override; |
| 180 virtual void OnInitialLoadComplete() OVERRIDE; | 180 virtual void OnInitialLoadComplete() override; |
| 181 | 181 |
| 182 // Used by tests. | 182 // Used by tests. |
| 183 internal::ChangeListLoader* change_list_loader_for_testing() { | 183 internal::ChangeListLoader* change_list_loader_for_testing() { |
| 184 return change_list_loader_.get(); | 184 return change_list_loader_.get(); |
| 185 } | 185 } |
| 186 internal::SyncClient* sync_client_for_testing() { return sync_client_.get(); } | 186 internal::SyncClient* sync_client_for_testing() { return sync_client_.get(); } |
| 187 | 187 |
| 188 private: | 188 private: |
| 189 struct CreateDirectoryParams; | 189 struct CreateDirectoryParams; |
| 190 | 190 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 // Note: This should remain the last member so it'll be destroyed and | 297 // Note: This should remain the last member so it'll be destroyed and |
| 298 // invalidate the weak pointers before any other members are destroyed. | 298 // invalidate the weak pointers before any other members are destroyed. |
| 299 base::WeakPtrFactory<FileSystem> weak_ptr_factory_; | 299 base::WeakPtrFactory<FileSystem> weak_ptr_factory_; |
| 300 | 300 |
| 301 DISALLOW_COPY_AND_ASSIGN(FileSystem); | 301 DISALLOW_COPY_AND_ASSIGN(FileSystem); |
| 302 }; | 302 }; |
| 303 | 303 |
| 304 } // namespace drive | 304 } // namespace drive |
| 305 | 305 |
| 306 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_ | 306 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_ |
| OLD | NEW |