| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // A DownloadItem was created. This item may be visible before the filename | 76 // A DownloadItem was created. This item may be visible before the filename |
| 77 // is determined; in this case the return value of GetTargetFileName() will | 77 // is determined; in this case the return value of GetTargetFileName() will |
| 78 // be null. This method may be called an arbitrary number of times, e.g. | 78 // be null. This method may be called an arbitrary number of times, e.g. |
| 79 // when loading history on startup. As a result, consumers should avoid | 79 // when loading history on startup. As a result, consumers should avoid |
| 80 // doing large amounts of work in OnDownloadCreated(). TODO(<whoever>): | 80 // doing large amounts of work in OnDownloadCreated(). TODO(<whoever>): |
| 81 // When we've fully specified the possible states of the DownloadItem in | 81 // When we've fully specified the possible states of the DownloadItem in |
| 82 // download_item.h, we should remove the caveat above. | 82 // download_item.h, we should remove the caveat above. |
| 83 virtual void OnDownloadCreated( | 83 virtual void OnDownloadCreated( |
| 84 DownloadManager* manager, DownloadItem* item) {} | 84 DownloadManager* manager, DownloadItem* item) {} |
| 85 | 85 |
| 86 // A SavePackage has successfully finished. | 86 // A SavePackage has finished. |
| 87 virtual void OnSavePackageSuccessfullyFinished( | 87 // First param is true when saving was fully successfull. |
| 88 DownloadManager* manager, DownloadItem* item) {} | 88 virtual void OnSavePackageFinished( |
| 89 bool success, DownloadManager* manager, DownloadItem* item) {} |
| 89 | 90 |
| 90 // Called when the DownloadManager is being destroyed to prevent Observers | 91 // Called when the DownloadManager is being destroyed to prevent Observers |
| 91 // from calling back to a stale pointer. | 92 // from calling back to a stale pointer. |
| 92 virtual void ManagerGoingDown(DownloadManager* manager) {} | 93 virtual void ManagerGoingDown(DownloadManager* manager) {} |
| 93 | 94 |
| 94 protected: | 95 protected: |
| 95 virtual ~Observer() {} | 96 virtual ~Observer() {} |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 typedef std::vector<DownloadItem*> DownloadVector; | 99 typedef std::vector<DownloadItem*> DownloadVector; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 virtual void CheckForHistoryFilesRemoval() = 0; | 173 virtual void CheckForHistoryFilesRemoval() = 0; |
| 173 | 174 |
| 174 // Get the download item for |id| if present, no matter what type of download | 175 // Get the download item for |id| if present, no matter what type of download |
| 175 // it is or state it's in. | 176 // it is or state it's in. |
| 176 virtual DownloadItem* GetDownload(uint32 id) = 0; | 177 virtual DownloadItem* GetDownload(uint32 id) = 0; |
| 177 }; | 178 }; |
| 178 | 179 |
| 179 } // namespace content | 180 } // namespace content |
| 180 | 181 |
| 181 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 182 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |