| Index: chrome/browser/chromeos/gdata/gdata_download_observer.h
|
| diff --git a/chrome/browser/chromeos/gdata/gdata_download_observer.h b/chrome/browser/chromeos/gdata/gdata_download_observer.h
|
| index 576cbc93a69781cbe534edf65f225f4b1acbec86..b8d1e27e9c9a7605e18b1431e98b15108f66dd0a 100644
|
| --- a/chrome/browser/chromeos/gdata/gdata_download_observer.h
|
| +++ b/chrome/browser/chromeos/gdata/gdata_download_observer.h
|
| @@ -19,6 +19,7 @@ class Profile;
|
| namespace gdata {
|
|
|
| class DocumentEntry;
|
| +class GDataFileSystem;
|
| class GDataUploader;
|
| struct UploadFileInfo;
|
|
|
| @@ -27,12 +28,11 @@ struct UploadFileInfo;
|
| class GDataDownloadObserver : public content::DownloadManager::Observer,
|
| public content::DownloadItem::Observer {
|
| public:
|
| - GDataDownloadObserver();
|
| + GDataDownloadObserver(GDataUploader* uploader, GDataFileSystem* file_system);
|
| virtual ~GDataDownloadObserver();
|
|
|
| // Become an observer of DownloadManager.
|
| - void Initialize(GDataUploader* gdata_uploader,
|
| - content::DownloadManager* download_manager,
|
| + void Initialize(content::DownloadManager* download_manager,
|
| const FilePath& gdata_tmp_download_path);
|
|
|
| typedef base::Callback<void(const FilePath&)>
|
| @@ -115,14 +115,22 @@ class GDataDownloadObserver : public content::DownloadManager::Observer,
|
| // Callback invoked by GDataUploader when the upload associated with
|
| // |download_id| has completed. |error| indicated whether the
|
| // call was successful. This function invokes the MaybeCompleteDownload()
|
| - // method on the DownloadItem to allow it to complete.
|
| + // method on the DownloadItem to allow it to complete. It also sets external
|
| + // data struct GDataCacheExternalData for use by MoveDownloadedFileToCache().
|
| void OnUploadComplete(int32 download_id,
|
| base::PlatformFileError error,
|
| scoped_ptr<UploadFileInfo> upload_file_info);
|
|
|
| + // Moves the downloaded file to gdata cache. Invokes |callback| on completion.
|
| + // Must be called after GDataDownloadObserver receives COMPLETE notification.
|
| + void MoveDownloadedFileToCache(content::DownloadItem* download,
|
| + const base::Closure& callback);
|
| +
|
| // Private data.
|
| - // Use GDataUploader to trigger file uploads.
|
| + // The uploader owned by GDataSystemService. Used to trigger file uploads.
|
| GDataUploader* gdata_uploader_;
|
| + // The file system owned by GDataSystemService.
|
| + GDataFileSystem* file_system_;
|
| // Observe the DownloadManager for new downloads.
|
| content::DownloadManager* download_manager_;
|
|
|
|
|