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_DRIVE_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_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.h" | |
15 #include "chrome/browser/chromeos/drive/change_list_loader_observer.h" | 14 #include "chrome/browser/chromeos/drive/change_list_loader_observer.h" |
16 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" | 15 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" |
17 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" | 16 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
18 #include "chrome/browser/chromeos/drive/file_system/drive_operations.h" | 17 #include "chrome/browser/chromeos/drive/file_system/drive_operations.h" |
19 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" | 18 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" |
20 #include "chrome/browser/google_apis/gdata_errorcode.h" | 19 #include "chrome/browser/google_apis/gdata_errorcode.h" |
21 | 20 |
22 class PrefChangeRegistrar; | 21 class PrefChangeRegistrar; |
23 class Profile; | 22 class Profile; |
24 | 23 |
25 namespace base { | 24 namespace base { |
26 struct PlatformFileInfo; | 25 struct PlatformFileInfo; |
27 class SequencedTaskRunner; | 26 class SequencedTaskRunner; |
28 } | 27 } |
29 | 28 |
30 namespace google_apis { | 29 namespace google_apis { |
31 class AboutResource; | 30 class AboutResource; |
32 class DriveServiceInterface; | 31 class DriveServiceInterface; |
33 class ResourceEntry; | 32 class ResourceEntry; |
34 } | 33 } |
35 | 34 |
36 namespace drive { | 35 namespace drive { |
37 | 36 |
38 class DriveCacheEntry; | 37 class DriveCacheEntry; |
39 class DriveFileSystemObserver; | 38 class DriveFileSystemObserver; |
40 class DriveFunctionRemove; | |
41 class DriveResourceMetadata; | 39 class DriveResourceMetadata; |
42 class DriveScheduler; | 40 class DriveScheduler; |
43 class DriveWebAppsRegistry; | 41 class DriveWebAppsRegistry; |
| 42 class ChangeList; |
44 class ChangeListLoader; | 43 class ChangeListLoader; |
45 | 44 |
46 namespace file_system { | |
47 class CopyOperation; | |
48 class MoveOperation; | |
49 class RemoveOperation; | |
50 } | |
51 | |
52 // The production implementation of DriveFileSystemInterface. | 45 // The production implementation of DriveFileSystemInterface. |
53 class DriveFileSystem : public DriveFileSystemInterface, | 46 class DriveFileSystem : public DriveFileSystemInterface, |
54 public ChangeListLoaderObserver, | 47 public ChangeListLoaderObserver, |
55 public file_system::OperationObserver { | 48 public file_system::OperationObserver { |
56 public: | 49 public: |
57 DriveFileSystem(Profile* profile, | 50 DriveFileSystem(Profile* profile, |
58 DriveCache* cache, | 51 DriveCache* cache, |
59 google_apis::DriveServiceInterface* drive_service, | 52 google_apis::DriveServiceInterface* drive_service, |
60 DriveScheduler* scheduler, | 53 DriveScheduler* scheduler, |
61 DriveWebAppsRegistry* webapps_registry, | 54 DriveWebAppsRegistry* webapps_registry, |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 const DriveCacheEntry& cache_entry); | 366 const DriveCacheEntry& cache_entry); |
374 void GetResolvedFileByPathAfterStore( | 367 void GetResolvedFileByPathAfterStore( |
375 scoped_ptr<GetResolvedFileParams> params, | 368 scoped_ptr<GetResolvedFileParams> params, |
376 const base::FilePath& downloaded_file_path, | 369 const base::FilePath& downloaded_file_path, |
377 DriveFileError error); | 370 DriveFileError error); |
378 void GetResolvedFileByPathAfterGetFile( | 371 void GetResolvedFileByPathAfterGetFile( |
379 scoped_ptr<GetResolvedFileParams> params, | 372 scoped_ptr<GetResolvedFileParams> params, |
380 DriveFileError error, | 373 DriveFileError error, |
381 const base::FilePath& cache_file); | 374 const base::FilePath& cache_file); |
382 | 375 |
383 // Loads the file system from the cache or the server via change lists if | |
384 // the file system is not yet loaded. Runs |callback| upon the completion | |
385 // with the error code. |callback| must not be null. | |
386 void LoadIfNeeded(const DirectoryFetchInfo& directory_fetch_info, | |
387 const FileOperationCallback& callback); | |
388 | |
389 // Part of GetEntryInfoByResourceId(). Called after | 376 // Part of GetEntryInfoByResourceId(). Called after |
390 // DriveResourceMetadata::GetEntryInfoByResourceId() is complete. | 377 // DriveResourceMetadata::GetEntryInfoByResourceId() is complete. |
391 // |callback| must not be null. | 378 // |callback| must not be null. |
392 void GetEntryInfoByResourceIdAfterGetEntry( | 379 void GetEntryInfoByResourceIdAfterGetEntry( |
393 const GetEntryInfoWithFilePathCallback& callback, | 380 const GetEntryInfoWithFilePathCallback& callback, |
394 DriveFileError error, | 381 DriveFileError error, |
395 const base::FilePath& file_path, | 382 const base::FilePath& file_path, |
396 scoped_ptr<DriveEntryProto> entry_proto); | 383 scoped_ptr<DriveEntryProto> entry_proto); |
397 | 384 |
398 // Part of GetFileByResourceId(). Called after | 385 // Part of GetFileByResourceId(). Called after |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 // Note: This should remain the last member so it'll be destroyed and | 475 // Note: This should remain the last member so it'll be destroyed and |
489 // invalidate the weak pointers before any other members are destroyed. | 476 // invalidate the weak pointers before any other members are destroyed. |
490 base::WeakPtrFactory<DriveFileSystem> weak_ptr_factory_; | 477 base::WeakPtrFactory<DriveFileSystem> weak_ptr_factory_; |
491 | 478 |
492 DISALLOW_COPY_AND_ASSIGN(DriveFileSystem); | 479 DISALLOW_COPY_AND_ASSIGN(DriveFileSystem); |
493 }; | 480 }; |
494 | 481 |
495 } // namespace drive | 482 } // namespace drive |
496 | 483 |
497 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_ | 484 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_ |
OLD | NEW |