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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 // Allow objects to observe the download creation process. | 138 // Allow objects to observe the download creation process. |
139 virtual void AddObserver(Observer* observer) = 0; | 139 virtual void AddObserver(Observer* observer) = 0; |
140 | 140 |
141 // Remove a download observer from ourself. | 141 // Remove a download observer from ourself. |
142 virtual void RemoveObserver(Observer* observer) = 0; | 142 virtual void RemoveObserver(Observer* observer) = 0; |
143 | 143 |
144 // Called by the embedder, after creating the download manager, to let it know | 144 // Called by the embedder, after creating the download manager, to let it know |
145 // about downloads from previous runs of the browser. | 145 // about downloads from previous runs of the browser. |
146 virtual DownloadItem* CreateDownloadItem( | 146 virtual DownloadItem* CreateDownloadItem( |
147 const FilePath& path, | 147 const FilePath& current_path, |
148 const GURL& url, | 148 const FilePath& target_path, |
| 149 const std::vector<GURL>& url_chain, |
149 const GURL& referrer_url, | 150 const GURL& referrer_url, |
150 const base::Time& start_time, | 151 const base::Time& start_time, |
151 const base::Time& end_time, | 152 const base::Time& end_time, |
152 int64 received_bytes, | 153 int64 received_bytes, |
153 int64 total_bytes, | 154 int64 total_bytes, |
154 DownloadItem::DownloadState state, | 155 DownloadItem::DownloadState state, |
| 156 DownloadDangerType danger_type, |
| 157 DownloadInterruptReason interrupt_reason, |
155 bool opened) = 0; | 158 bool opened) = 0; |
156 | 159 |
157 // The number of in progress (including paused) downloads. | 160 // The number of in progress (including paused) downloads. |
158 // Performance note: this loops over all items. If profiling finds that this | 161 // Performance note: this loops over all items. If profiling finds that this |
159 // is too slow, use an AllDownloadItemNotifier to count in-progress items. | 162 // is too slow, use an AllDownloadItemNotifier to count in-progress items. |
160 virtual int InProgressCount() const = 0; | 163 virtual int InProgressCount() const = 0; |
161 | 164 |
162 virtual BrowserContext* GetBrowserContext() const = 0; | 165 virtual BrowserContext* GetBrowserContext() const = 0; |
163 | 166 |
164 // Checks whether downloaded files still exist. Updates state of downloads | 167 // Checks whether downloaded files still exist. Updates state of downloads |
(...skipping 11 matching lines...) Expand all Loading... |
176 protected: | 179 protected: |
177 virtual ~DownloadManager() {} | 180 virtual ~DownloadManager() {} |
178 | 181 |
179 private: | 182 private: |
180 friend class base::RefCountedThreadSafe<DownloadManager>; | 183 friend class base::RefCountedThreadSafe<DownloadManager>; |
181 }; | 184 }; |
182 | 185 |
183 } // namespace content | 186 } // namespace content |
184 | 187 |
185 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 188 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
OLD | NEW |