OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 | 12 |
13 class DownloadItem; | 13 class DownloadItem; |
14 class FilePath; | 14 class FilePath; |
15 class TabContents; | 15 class TabContents; |
16 class SavePackage; | 16 class SavePackage; |
17 | 17 |
18 // Browser's download manager: manages all downloads and destination view. | 18 // Browser's download manager: manages all downloads and destination view. |
19 class DownloadManagerDelegate { | 19 class DownloadManagerDelegate { |
20 public: | 20 public: |
| 21 virtual ~DownloadManagerDelegate() {} |
| 22 |
21 // Lets the delegate know that the download manager is shutting down. | 23 // Lets the delegate know that the download manager is shutting down. |
22 virtual void Shutdown() = 0; | 24 virtual void Shutdown() = 0; |
23 | 25 |
24 // Notifies the delegate that a download is starting. The delegate can return | 26 // Notifies the delegate that a download is starting. The delegate can return |
25 // false to delay the start of the download, in which case it should call | 27 // false to delay the start of the download, in which case it should call |
26 // DownloadManager::RestartDownload when it's ready. | 28 // DownloadManager::RestartDownload when it's ready. |
27 virtual bool ShouldStartDownload(int32 download_id) = 0; | 29 virtual bool ShouldStartDownload(int32 download_id) = 0; |
28 | 30 |
29 // Asks the user for the path for a download. The delegate calls | 31 // Asks the user for the path for a download. The delegate calls |
30 // DownloadManager::FileSelected or DownloadManager::FileSelectionCanceled to | 32 // DownloadManager::FileSelected or DownloadManager::FileSelectionCanceled to |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // SavePackage::OnPathPicked to give the answer. | 95 // SavePackage::OnPathPicked to give the answer. |
94 virtual void ChooseSavePath(const base::WeakPtr<SavePackage>& save_package, | 96 virtual void ChooseSavePath(const base::WeakPtr<SavePackage>& save_package, |
95 const FilePath& suggested_path, | 97 const FilePath& suggested_path, |
96 bool can_save_as_complete) = 0; | 98 bool can_save_as_complete) = 0; |
97 | 99 |
98 // Informs the delegate that the progress of downloads has changed. | 100 // Informs the delegate that the progress of downloads has changed. |
99 virtual void DownloadProgressUpdated() = 0; | 101 virtual void DownloadProgressUpdated() = 0; |
100 | 102 |
101 protected: | 103 protected: |
102 DownloadManagerDelegate() {} | 104 DownloadManagerDelegate() {} |
103 virtual ~DownloadManagerDelegate() {} | |
104 | 105 |
105 DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegate); | 106 DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegate); |
106 }; | 107 }; |
107 | 108 |
108 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ | 109 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |