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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 // Called by a download source (Currently DownloadResourceHandler) | 108 // Called by a download source (Currently DownloadResourceHandler) |
109 // to initiate the non-source portions of a download. | 109 // to initiate the non-source portions of a download. |
110 // Returns the id assigned to the download. If the DownloadCreateInfo | 110 // Returns the id assigned to the download. If the DownloadCreateInfo |
111 // specifies an id, that id will be used. | 111 // specifies an id, that id will be used. |
112 virtual void StartDownload( | 112 virtual void StartDownload( |
113 scoped_ptr<DownloadCreateInfo> info, | 113 scoped_ptr<DownloadCreateInfo> info, |
114 scoped_ptr<ByteStreamReader> stream, | 114 scoped_ptr<ByteStreamReader> stream, |
115 const DownloadUrlParameters::OnStartedCallback& on_started) = 0; | 115 const DownloadUrlParameters::OnStartedCallback& on_started) = 0; |
116 | 116 |
117 // Remove downloads which are same-origin with the given origin and pertain to | 117 // Remove downloads whose URLs match the |url_filter| and are within |
118 // the given time constraints. (See |RemoveDownloadsBetween|.) | 118 // the given time constraints - after remove_begin (inclusive) and before |
119 virtual int RemoveDownloadsByOriginAndTime(const url::Origin& origin, | 119 // remove_end (exclusive). You may pass in null Time values to do an unbounded |
120 base::Time remove_begin, | 120 // delete in either direction. |
121 base::Time remove_end) = 0; | 121 virtual int RemoveDownloadsByOriginAndTime( |
122 | 122 const base::Callback<bool(const GURL&)>& url_filter, |
123 // Remove downloads after remove_begin (inclusive) and before remove_end | 123 base::Time remove_begin, |
124 // (exclusive). You may pass in null Time values to do an unbounded delete | 124 base::Time remove_end) = 0; |
125 // in either direction. | |
126 virtual int RemoveDownloadsBetween(base::Time remove_begin, | |
127 base::Time remove_end) = 0; | |
128 | 125 |
129 // Remove downloads will delete all downloads that have a timestamp that is | 126 // Remove downloads will delete all downloads that have a timestamp that is |
130 // the same or more recent than |remove_begin|. The number of downloads | 127 // the same or more recent than |remove_begin|. The number of downloads |
131 // deleted is returned back to the caller. | 128 // deleted is returned back to the caller. |
132 virtual int RemoveDownloads(base::Time remove_begin) = 0; | 129 virtual int RemoveDownloads(base::Time remove_begin) = 0; |
133 | 130 |
134 // Remove all downloads will delete all downloads. The number of downloads | 131 // Remove all downloads will delete all downloads. The number of downloads |
135 // deleted is returned back to the caller. | 132 // deleted is returned back to the caller. |
136 virtual int RemoveAllDownloads() = 0; | 133 virtual int RemoveAllDownloads() = 0; |
137 | 134 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 virtual void CheckForHistoryFilesRemoval() = 0; | 181 virtual void CheckForHistoryFilesRemoval() = 0; |
185 | 182 |
186 // Get the download item for |id| if present, no matter what type of download | 183 // Get the download item for |id| if present, no matter what type of download |
187 // it is or state it's in. | 184 // it is or state it's in. |
188 virtual DownloadItem* GetDownload(uint32_t id) = 0; | 185 virtual DownloadItem* GetDownload(uint32_t id) = 0; |
189 }; | 186 }; |
190 | 187 |
191 } // namespace content | 188 } // namespace content |
192 | 189 |
193 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 190 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |