| 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 |
| 165 // that refer to removed files. The check runs in the background and may | 168 // that refer to removed files. The check runs in the background and may |
| 166 // finish asynchronously after this method returns. | 169 // finish asynchronously after this method returns. |
| 167 virtual void CheckForHistoryFilesRemoval() = 0; | 170 virtual void CheckForHistoryFilesRemoval() = 0; |
| 168 | 171 |
| 169 // Get the download item for |id| if present, no matter what type of download | 172 // Get the download item for |id| if present, no matter what type of download |
| 170 // it is or state it's in. | 173 // it is or state it's in. |
| 171 virtual DownloadItem* GetDownload(int id) = 0; | 174 virtual DownloadItem* GetDownload(int id) = 0; |
| 172 | 175 |
| 173 protected: | 176 protected: |
| 174 virtual ~DownloadManager() {} | 177 virtual ~DownloadManager() {} |
| 175 | 178 |
| 176 private: | 179 private: |
| 177 friend class base::RefCountedThreadSafe<DownloadManager>; | 180 friend class base::RefCountedThreadSafe<DownloadManager>; |
| 178 }; | 181 }; |
| 179 | 182 |
| 180 } // namespace content | 183 } // namespace content |
| 181 | 184 |
| 182 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 185 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |