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_GDATA_GDATA_DOWNLOAD_OBSERVER_H__ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H__ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H__ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // Creates UploadFileInfo and initializes it using DownloadItem*. | 111 // Creates UploadFileInfo and initializes it using DownloadItem*. |
112 scoped_ptr<UploadFileInfo> CreateUploadFileInfo( | 112 scoped_ptr<UploadFileInfo> CreateUploadFileInfo( |
113 content::DownloadItem* download); | 113 content::DownloadItem* download); |
114 | 114 |
115 // Callback invoked by GDataUploader when the upload associated with | 115 // Callback invoked by GDataUploader when the upload associated with |
116 // |download_id| has completed. |error| indicated whether the | 116 // |download_id| has completed. |error| indicated whether the |
117 // call was successful. This function invokes the MaybeCompleteDownload() | 117 // call was successful. This function invokes the MaybeCompleteDownload() |
118 // method on the DownloadItem to allow it to complete. | 118 // method on the DownloadItem to allow it to complete. |
119 void OnUploadComplete(int32 download_id, | 119 void OnUploadComplete(int32 download_id, |
120 base::PlatformFileError error, | 120 base::PlatformFileError error, |
121 UploadFileInfo* upload_file_info); | 121 scoped_ptr<UploadFileInfo> upload_file_info); |
122 | 122 |
123 // Private data. | 123 // Private data. |
124 // Use GDataUploader to trigger file uploads. | 124 // Use GDataUploader to trigger file uploads. |
125 GDataUploader* gdata_uploader_; | 125 GDataUploader* gdata_uploader_; |
126 // Observe the DownloadManager for new downloads. | 126 // Observe the DownloadManager for new downloads. |
127 content::DownloadManager* download_manager_; | 127 content::DownloadManager* download_manager_; |
128 | 128 |
129 // Temporary download location directory. | 129 // Temporary download location directory. |
130 FilePath gdata_tmp_download_path_; | 130 FilePath gdata_tmp_download_path_; |
131 | 131 |
132 // Map of pending downloads. | 132 // Map of pending downloads. |
133 typedef std::map<int32, content::DownloadItem*> DownloadMap; | 133 typedef std::map<int32, content::DownloadItem*> DownloadMap; |
134 DownloadMap pending_downloads_; | 134 DownloadMap pending_downloads_; |
135 | 135 |
136 base::WeakPtrFactory<GDataDownloadObserver> weak_ptr_factory_; | 136 base::WeakPtrFactory<GDataDownloadObserver> weak_ptr_factory_; |
137 | 137 |
138 DISALLOW_COPY_AND_ASSIGN(GDataDownloadObserver); | 138 DISALLOW_COPY_AND_ASSIGN(GDataDownloadObserver); |
139 }; | 139 }; |
140 | 140 |
141 } // namespace gdata | 141 } // namespace gdata |
142 | 142 |
143 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H__ | 143 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_DOWNLOAD_OBSERVER_H__ |
OLD | NEW |