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 // The DownloadManager object manages the process of downloading, including | 5 // The DownloadManager object manages the process of downloading, including |
6 // updates to the history system and providing the information for displaying | 6 // updates to the history system and providing the information for displaying |
7 // the downloads view in the Destinations tab. There is one DownloadManager per | 7 // the downloads view in the Destinations tab. There is one DownloadManager per |
8 // active browser context in Chrome. | 8 // active browser context in Chrome. |
9 // | 9 // |
10 // Download observers: | 10 // Download observers: |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // deleted is returned back to the caller. | 160 // deleted is returned back to the caller. |
161 virtual int RemoveDownloads(base::Time remove_begin) = 0; | 161 virtual int RemoveDownloads(base::Time remove_begin) = 0; |
162 | 162 |
163 // Remove all downloads will delete all downloads. The number of downloads | 163 // Remove all downloads will delete all downloads. The number of downloads |
164 // deleted is returned back to the caller. | 164 // deleted is returned back to the caller. |
165 virtual int RemoveAllDownloads() = 0; | 165 virtual int RemoveAllDownloads() = 0; |
166 | 166 |
167 // Downloads the content at |url|. |referrer| and |referrer_encoding| are the | 167 // Downloads the content at |url|. |referrer| and |referrer_encoding| are the |
168 // referrer for the download, and may be empty. If |prefer_cache| is true, | 168 // referrer for the download, and may be empty. If |prefer_cache| is true, |
169 // then if the response to |url| is in the HTTP cache it will be used without | 169 // then if the response to |url| is in the HTTP cache it will be used without |
170 // revalidation. |save_info| specifies where the downloaded file should be | 170 // revalidation. If |post_id| is non-negative, then it identifies the post |
| 171 // transaction used to originally retrieve the |url| resource - it also |
| 172 // requires |prefer_cache| to be |true| since re-post'ing is not done. |
| 173 // |save_info| specifies where the downloaded file should be |
171 // saved, and whether the user should be prompted about the download. | 174 // saved, and whether the user should be prompted about the download. |
172 // |web_contents| is the web page that the download is done in context of, | 175 // |web_contents| is the web page that the download is done in context of, |
173 // and must be non-NULL. | 176 // and must be non-NULL. |
174 virtual void DownloadUrl(const GURL& url, | 177 virtual void DownloadUrl(const GURL& url, |
175 const GURL& referrer, | 178 const GURL& referrer, |
176 const std::string& referrer_encoding, | 179 const std::string& referrer_encoding, |
177 bool prefer_cache, | 180 bool prefer_cache, |
| 181 int64 post_id, |
178 const DownloadSaveInfo& save_info, | 182 const DownloadSaveInfo& save_info, |
179 content::WebContents* web_contents) = 0; | 183 content::WebContents* web_contents) = 0; |
180 | 184 |
181 // Allow objects to observe the download creation process. | 185 // Allow objects to observe the download creation process. |
182 virtual void AddObserver(Observer* observer) = 0; | 186 virtual void AddObserver(Observer* observer) = 0; |
183 | 187 |
184 // Remove a download observer from ourself. | 188 // Remove a download observer from ourself. |
185 virtual void RemoveObserver(Observer* observer) = 0; | 189 virtual void RemoveObserver(Observer* observer) = 0; |
186 | 190 |
187 // Called by the embedder, after creating the download manager, to let it know | 191 // Called by the embedder, after creating the download manager, to let it know |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 friend class base::RefCountedThreadSafe< | 277 friend class base::RefCountedThreadSafe< |
274 DownloadManager, content::BrowserThread::DeleteOnUIThread>; | 278 DownloadManager, content::BrowserThread::DeleteOnUIThread>; |
275 friend struct content::BrowserThread::DeleteOnThread< | 279 friend struct content::BrowserThread::DeleteOnThread< |
276 content::BrowserThread::UI>; | 280 content::BrowserThread::UI>; |
277 friend class base::DeleteHelper<DownloadManager>; | 281 friend class base::DeleteHelper<DownloadManager>; |
278 }; | 282 }; |
279 | 283 |
280 } // namespace content | 284 } // namespace content |
281 | 285 |
282 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 286 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |