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 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "chrome/browser/chromeos/drive/change_list_loader_observer.h" | 14 #include "chrome/browser/chromeos/drive/change_list_loader_observer.h" |
15 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" | 15 #include "chrome/browser/chromeos/drive/file_system/operation_delegate.h" |
16 #include "chrome/browser/chromeos/drive/file_system_interface.h" | 16 #include "chrome/browser/chromeos/drive/file_system_interface.h" |
17 #include "google_apis/drive/gdata_errorcode.h" | 17 #include "google_apis/drive/gdata_errorcode.h" |
18 | 18 |
19 class PrefService; | 19 class PrefService; |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class SequencedTaskRunner; | 22 class SequencedTaskRunner; |
23 } // namespace base | 23 } // namespace base |
24 | 24 |
25 namespace google_apis { | 25 namespace google_apis { |
(...skipping 20 matching lines...) Expand all Loading... |
46 } // namespace internal | 46 } // namespace internal |
47 | 47 |
48 namespace file_system { | 48 namespace file_system { |
49 class CopyOperation; | 49 class CopyOperation; |
50 class CreateDirectoryOperation; | 50 class CreateDirectoryOperation; |
51 class CreateFileOperation; | 51 class CreateFileOperation; |
52 class DownloadOperation; | 52 class DownloadOperation; |
53 class GetFileForSavingOperation; | 53 class GetFileForSavingOperation; |
54 class MoveOperation; | 54 class MoveOperation; |
55 class OpenFileOperation; | 55 class OpenFileOperation; |
56 class OperationObserver; | |
57 class RemoveOperation; | 56 class RemoveOperation; |
58 class SearchOperation; | 57 class SearchOperation; |
59 class TouchOperation; | 58 class TouchOperation; |
60 class TruncateOperation; | 59 class TruncateOperation; |
61 } // namespace file_system | 60 } // namespace file_system |
62 | 61 |
63 // The production implementation of FileSystemInterface. | 62 // The production implementation of FileSystemInterface. |
64 class FileSystem : public FileSystemInterface, | 63 class FileSystem : public FileSystemInterface, |
65 public internal::ChangeListLoaderObserver, | 64 public internal::ChangeListLoaderObserver, |
66 public file_system::OperationObserver { | 65 public file_system::OperationDelegate { |
67 public: | 66 public: |
68 FileSystem(PrefService* pref_service, | 67 FileSystem(PrefService* pref_service, |
69 EventLogger* logger, | 68 EventLogger* logger, |
70 internal::FileCache* cache, | 69 internal::FileCache* cache, |
71 DriveServiceInterface* drive_service, | 70 DriveServiceInterface* drive_service, |
72 JobScheduler* scheduler, | 71 JobScheduler* scheduler, |
73 internal::ResourceMetadata* resource_metadata, | 72 internal::ResourceMetadata* resource_metadata, |
74 base::SequencedTaskRunner* blocking_task_runner, | 73 base::SequencedTaskRunner* blocking_task_runner, |
75 const base::FilePath& temporary_file_directory); | 74 const base::FilePath& temporary_file_directory); |
76 virtual ~FileSystem(); | 75 virtual ~FileSystem(); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 const FileOperationCallback& callback) OVERRIDE; | 154 const FileOperationCallback& callback) OVERRIDE; |
156 virtual void AddPermission(const base::FilePath& drive_file_path, | 155 virtual void AddPermission(const base::FilePath& drive_file_path, |
157 const std::string& email, | 156 const std::string& email, |
158 google_apis::drive::PermissionRole role, | 157 google_apis::drive::PermissionRole role, |
159 const FileOperationCallback& callback) OVERRIDE; | 158 const FileOperationCallback& callback) OVERRIDE; |
160 virtual void Reset(const FileOperationCallback& callback) OVERRIDE; | 159 virtual void Reset(const FileOperationCallback& callback) OVERRIDE; |
161 virtual void GetPathFromResourceId(const std::string& resource_id, | 160 virtual void GetPathFromResourceId(const std::string& resource_id, |
162 const GetFilePathCallback& callback) | 161 const GetFilePathCallback& callback) |
163 OVERRIDE; | 162 OVERRIDE; |
164 | 163 |
165 // file_system::OperationObserver overrides. | 164 // file_system::OperationDelegate overrides. |
166 virtual void OnFileChangedByOperation( | 165 virtual void OnFileChangedByOperation( |
167 const FileChange& changed_files) OVERRIDE; | 166 const FileChange& changed_files) OVERRIDE; |
168 virtual void OnEntryUpdatedByOperation(const std::string& local_id) OVERRIDE; | 167 virtual void OnEntryUpdatedByOperation(const std::string& local_id) OVERRIDE; |
169 virtual void OnDriveSyncError(file_system::DriveSyncErrorType type, | 168 virtual void OnDriveSyncError(file_system::DriveSyncErrorType type, |
170 const std::string& local_id) OVERRIDE; | 169 const std::string& local_id) OVERRIDE; |
171 virtual bool WaitForSyncComplete( | 170 virtual bool WaitForSyncComplete( |
172 const std::string& local_id, | 171 const std::string& local_id, |
173 const FileOperationCallback& callback) OVERRIDE; | 172 const FileOperationCallback& callback) OVERRIDE; |
174 | 173 |
175 // ChangeListLoader::Observer overrides. | 174 // ChangeListLoader::Observer overrides. |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 // 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 |
299 // invalidate the weak pointers before any other members are destroyed. | 298 // invalidate the weak pointers before any other members are destroyed. |
300 base::WeakPtrFactory<FileSystem> weak_ptr_factory_; | 299 base::WeakPtrFactory<FileSystem> weak_ptr_factory_; |
301 | 300 |
302 DISALLOW_COPY_AND_ASSIGN(FileSystem); | 301 DISALLOW_COPY_AND_ASSIGN(FileSystem); |
303 }; | 302 }; |
304 | 303 |
305 } // namespace drive | 304 } // namespace drive |
306 | 305 |
307 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_ | 306 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_SYSTEM_H_ |
OLD | NEW |