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 "base/timer.h" | 14 #include "base/timer.h" |
15 #include "chrome/browser/chromeos/drive/drive_feed_loader_observer.h" | 15 #include "chrome/browser/chromeos/drive/drive_feed_loader_observer.h" |
16 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" | 16 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" |
17 #include "chrome/browser/chromeos/drive/file_system/drive_operations.h" | 17 #include "chrome/browser/chromeos/drive/file_system/drive_operations.h" |
18 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" | 18 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" |
19 #include "chrome/browser/google_apis/gdata_errorcode.h" | 19 #include "chrome/browser/google_apis/gdata_errorcode.h" |
20 | 20 |
21 class PrefChangeRegistrar; | 21 class PrefChangeRegistrar; |
22 class Profile; | 22 class Profile; |
23 | 23 |
24 namespace base { | 24 namespace base { |
25 struct PlatformFileInfo; | 25 struct PlatformFileInfo; |
26 class SequencedTaskRunner; | 26 class SequencedTaskRunner; |
27 } | 27 } |
28 | 28 |
29 namespace google_apis { | 29 namespace google_apis { |
| 30 class ResourceEntry; |
30 class ResourceList; | 31 class ResourceList; |
31 class DriveServiceInterface; | 32 class DriveServiceInterface; |
32 class DriveUploaderInterface; | 33 class DriveUploaderInterface; |
33 } | 34 } |
34 | 35 |
35 namespace drive { | 36 namespace drive { |
36 | 37 |
37 class DriveCacheEntry; | 38 class DriveCacheEntry; |
38 class DriveFileSystemObserver; | 39 class DriveFileSystemObserver; |
39 class DriveFunctionRemove; | 40 class DriveFunctionRemove; |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 void OnGetFileFromCache(const GetFileFromCacheParams& params, | 426 void OnGetFileFromCache(const GetFileFromCacheParams& params, |
426 DriveFileError error, | 427 DriveFileError error, |
427 const FilePath& cache_file_path); | 428 const FilePath& cache_file_path); |
428 | 429 |
429 // Callback for |drive_service_->GetResourceEntry|. | 430 // Callback for |drive_service_->GetResourceEntry|. |
430 // It is called before file download. If GetResourceEntry was successful, | 431 // It is called before file download. If GetResourceEntry was successful, |
431 // file download procedure is started for the file. The file is downloaded | 432 // file download procedure is started for the file. The file is downloaded |
432 // from the content url extracted from the fetched metadata. | 433 // from the content url extracted from the fetched metadata. |
433 void OnGetResourceEntry(const GetFileFromCacheParams& params, | 434 void OnGetResourceEntry(const GetFileFromCacheParams& params, |
434 google_apis::GDataErrorCode status, | 435 google_apis::GDataErrorCode status, |
435 scoped_ptr<base::Value> data); | 436 scoped_ptr<google_apis::ResourceEntry> entry); |
436 | 437 |
437 // Check available space using file size from the fetched metadata. Called | 438 // Check available space using file size from the fetched metadata. Called |
438 // from OnGetResourceEntry after RefreshFile is complete. | 439 // from OnGetResourceEntry after RefreshFile is complete. |
439 void CheckForSpaceBeforeDownload( | 440 void CheckForSpaceBeforeDownload( |
440 const GetFileFromCacheParams& params, | 441 const GetFileFromCacheParams& params, |
441 int64 file_size, | 442 int64 file_size, |
442 const GURL& content_url, | 443 const GURL& content_url, |
443 DriveFileError error, | 444 DriveFileError error, |
444 const FilePath& drive_file_path, | 445 const FilePath& drive_file_path, |
445 scoped_ptr<DriveEntryProto> entry_proto); | 446 scoped_ptr<DriveEntryProto> entry_proto); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 // invalidate the weak pointers before any other members are destroyed. | 669 // invalidate the weak pointers before any other members are destroyed. |
669 base::WeakPtrFactory<DriveFileSystem> ui_weak_ptr_factory_; | 670 base::WeakPtrFactory<DriveFileSystem> ui_weak_ptr_factory_; |
670 // Unlike other classes, we need this as we need this to redirect a task | 671 // Unlike other classes, we need this as we need this to redirect a task |
671 // from IO thread to UI thread. | 672 // from IO thread to UI thread. |
672 base::WeakPtr<DriveFileSystem> ui_weak_ptr_; | 673 base::WeakPtr<DriveFileSystem> ui_weak_ptr_; |
673 }; | 674 }; |
674 | 675 |
675 } // namespace drive | 676 } // namespace drive |
676 | 677 |
677 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_ | 678 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_ |
OLD | NEW |