| 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 18 matching lines...) Expand all Loading... |
| 29 #pragma once | 29 #pragma once |
| 30 | 30 |
| 31 #include <string> | 31 #include <string> |
| 32 #include <vector> | 32 #include <vector> |
| 33 | 33 |
| 34 #include "base/basictypes.h" | 34 #include "base/basictypes.h" |
| 35 #include "base/file_path.h" | 35 #include "base/file_path.h" |
| 36 #include "base/gtest_prod_util.h" | 36 #include "base/gtest_prod_util.h" |
| 37 #include "base/message_loop_helpers.h" | 37 #include "base/message_loop_helpers.h" |
| 38 #include "base/time.h" | 38 #include "base/time.h" |
| 39 #include "content/browser/download/interrupt_reasons.h" | |
| 40 #include "content/public/browser/download_id.h" | 39 #include "content/public/browser/download_id.h" |
| 40 #include "content/public/browser/download_interrupt_reasons.h" |
| 41 #include "content/public/browser/download_item.h" | 41 #include "content/public/browser/download_item.h" |
| 42 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
| 43 #include "net/base/net_log.h" | 43 #include "net/base/net_log.h" |
| 44 #include "net/base/net_errors.h" | 44 #include "net/base/net_errors.h" |
| 45 | 45 |
| 46 class DownloadFileManager; | 46 class DownloadFileManager; |
| 47 class DownloadManagerTest; | 47 class DownloadManagerTest; |
| 48 class DownloadRequestHandle; | 48 class DownloadRequestHandle; |
| 49 class GURL; | 49 class GURL; |
| 50 class TabContents; | 50 class TabContents; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Offthread target for cancelling a particular download. Will be a no-op | 132 // Offthread target for cancelling a particular download. Will be a no-op |
| 133 // if the download has already been cancelled. | 133 // if the download has already been cancelled. |
| 134 virtual void CancelDownload(int32 download_id) = 0; | 134 virtual void CancelDownload(int32 download_id) = 0; |
| 135 | 135 |
| 136 // Called when there is an error in the download. | 136 // Called when there is an error in the download. |
| 137 // |download_id| is the ID of the download. | 137 // |download_id| is the ID of the download. |
| 138 // |size| is the number of bytes that are currently downloaded. | 138 // |size| is the number of bytes that are currently downloaded. |
| 139 // |hash_state| is the current state of the hash of the data that has been | 139 // |hash_state| is the current state of the hash of the data that has been |
| 140 // downloaded. | 140 // downloaded. |
| 141 // |reason| is a download interrupt reason code. | 141 // |reason| is a download interrupt reason code. |
| 142 virtual void OnDownloadInterrupted(int32 download_id, | 142 virtual void OnDownloadInterrupted( |
| 143 int64 size, | 143 int32 download_id, |
| 144 const std::string& hash_state, | 144 int64 size, |
| 145 InterruptReason reason) = 0; | 145 const std::string& hash_state, |
| 146 content::DownloadInterruptReason reason) = 0; |
| 146 | 147 |
| 147 // Called when the download is renamed to its final name. | 148 // Called when the download is renamed to its final name. |
| 148 // |uniquifier| is a number used to make unique names for the file. It is | 149 // |uniquifier| is a number used to make unique names for the file. It is |
| 149 // only valid for the DANGEROUS_BUT_VALIDATED state of the download item. | 150 // only valid for the DANGEROUS_BUT_VALIDATED state of the download item. |
| 150 virtual void OnDownloadRenamedToFinalName(int download_id, | 151 virtual void OnDownloadRenamedToFinalName(int download_id, |
| 151 const FilePath& full_path, | 152 const FilePath& full_path, |
| 152 int uniquifier) = 0; | 153 int uniquifier) = 0; |
| 153 | 154 |
| 154 // Remove downloads after remove_begin (inclusive) and before remove_end | 155 // Remove downloads after remove_begin (inclusive) and before remove_end |
| 155 // (exclusive). You may pass in null Time values to do an unbounded delete | 156 // (exclusive). You may pass in null Time values to do an unbounded delete |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 friend class base::RefCountedThreadSafe< | 281 friend class base::RefCountedThreadSafe< |
| 281 DownloadManager, content::BrowserThread::DeleteOnUIThread>; | 282 DownloadManager, content::BrowserThread::DeleteOnUIThread>; |
| 282 friend struct content::BrowserThread::DeleteOnThread< | 283 friend struct content::BrowserThread::DeleteOnThread< |
| 283 content::BrowserThread::UI>; | 284 content::BrowserThread::UI>; |
| 284 friend class base::DeleteHelper<DownloadManager>; | 285 friend class base::DeleteHelper<DownloadManager>; |
| 285 }; | 286 }; |
| 286 | 287 |
| 287 } // namespace content | 288 } // namespace content |
| 288 | 289 |
| 289 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ | 290 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ |
| OLD | NEW |