| 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 29 matching lines...) Expand all Loading... |
| 40 #include "content/public/browser/download_item.h" | 40 #include "content/public/browser/download_item.h" |
| 41 #include "content/public/browser/download_url_parameters.h" | 41 #include "content/public/browser/download_url_parameters.h" |
| 42 #include "net/base/net_errors.h" | 42 #include "net/base/net_errors.h" |
| 43 #include "net/base/net_log.h" | 43 #include "net/base/net_log.h" |
| 44 | 44 |
| 45 class GURL; | 45 class GURL; |
| 46 | 46 |
| 47 namespace content { | 47 namespace content { |
| 48 | 48 |
| 49 class BrowserContext; | 49 class BrowserContext; |
| 50 template <typename StatusType> |
| 50 class ByteStreamReader; | 51 class ByteStreamReader; |
| 51 class DownloadManagerDelegate; | 52 class DownloadManagerDelegate; |
| 52 class DownloadQuery; | 53 class DownloadQuery; |
| 53 class DownloadRequestHandle; | 54 class DownloadRequestHandle; |
| 54 struct DownloadCreateInfo; | 55 struct DownloadCreateInfo; |
| 55 struct DownloadRetrieveInfo; | 56 struct DownloadRetrieveInfo; |
| 56 | 57 |
| 57 // Browser's download manager: manages all downloads and destination view. | 58 // Browser's download manager: manages all downloads and destination view. |
| 58 class CONTENT_EXPORT DownloadManager : public base::SupportsUserData::Data { | 59 class CONTENT_EXPORT DownloadManager : public base::SupportsUserData::Data { |
| 59 public: | 60 public: |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Add all download items to |downloads|, no matter the type or state, without | 102 // Add all download items to |downloads|, no matter the type or state, without |
| 102 // clearing |downloads| first. | 103 // clearing |downloads| first. |
| 103 virtual void GetAllDownloads(DownloadVector* downloads) = 0; | 104 virtual void GetAllDownloads(DownloadVector* downloads) = 0; |
| 104 | 105 |
| 105 // Called by a download source (Currently DownloadResourceHandler) | 106 // Called by a download source (Currently DownloadResourceHandler) |
| 106 // to initiate the non-source portions of a download. | 107 // to initiate the non-source portions of a download. |
| 107 // Returns the id assigned to the download. If the DownloadCreateInfo | 108 // Returns the id assigned to the download. If the DownloadCreateInfo |
| 108 // specifies an id, that id will be used. | 109 // specifies an id, that id will be used. |
| 109 virtual void StartDownload( | 110 virtual void StartDownload( |
| 110 scoped_ptr<DownloadCreateInfo> info, | 111 scoped_ptr<DownloadCreateInfo> info, |
| 111 scoped_ptr<ByteStreamReader> stream, | 112 scoped_ptr<ByteStreamReader<DownloadInterruptReason> > stream, |
| 112 const DownloadUrlParameters::OnStartedCallback& on_started) = 0; | 113 const DownloadUrlParameters::OnStartedCallback& on_started) = 0; |
| 113 | 114 |
| 114 // Remove downloads after remove_begin (inclusive) and before remove_end | 115 // Remove downloads after remove_begin (inclusive) and before remove_end |
| 115 // (exclusive). You may pass in null Time values to do an unbounded delete | 116 // (exclusive). You may pass in null Time values to do an unbounded delete |
| 116 // in either direction. | 117 // in either direction. |
| 117 virtual int RemoveDownloadsBetween(base::Time remove_begin, | 118 virtual int RemoveDownloadsBetween(base::Time remove_begin, |
| 118 base::Time remove_end) = 0; | 119 base::Time remove_end) = 0; |
| 119 | 120 |
| 120 // Remove downloads will delete all downloads that have a timestamp that is | 121 // Remove downloads will delete all downloads that have a timestamp that is |
| 121 // the same or more recent than |remove_begin|. The number of downloads | 122 // the same or more recent than |remove_begin|. The number of downloads |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 virtual void CheckForHistoryFilesRemoval() = 0; | 166 virtual void CheckForHistoryFilesRemoval() = 0; |
| 166 | 167 |
| 167 // Get the download item for |id| if present, no matter what type of download | 168 // Get the download item for |id| if present, no matter what type of download |
| 168 // it is or state it's in. | 169 // it is or state it's in. |
| 169 virtual DownloadItem* GetDownload(uint32 id) = 0; | 170 virtual DownloadItem* GetDownload(uint32 id) = 0; |
| 170 }; | 171 }; |
| 171 | 172 |
| 172 } // namespace content | 173 } // namespace content |
| 173 | 174 |
| 174 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 175 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |