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 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_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/callback.h" | 10 #include "base/callback.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // in response to this operation, the SavePackageDownloadCreatedCallback will be | 29 // in response to this operation, the SavePackageDownloadCreatedCallback will be |
30 // non-null. | 30 // non-null. |
31 typedef base::Callback<void(const FilePath&, | 31 typedef base::Callback<void(const FilePath&, |
32 content::SavePageType, | 32 content::SavePageType, |
33 const SavePackageDownloadCreatedCallback&)> | 33 const SavePackageDownloadCreatedCallback&)> |
34 SavePackagePathPickedCallback; | 34 SavePackagePathPickedCallback; |
35 | 35 |
36 // Browser's download manager: manages all downloads and destination view. | 36 // Browser's download manager: manages all downloads and destination view. |
37 class CONTENT_EXPORT DownloadManagerDelegate { | 37 class CONTENT_EXPORT DownloadManagerDelegate { |
38 public: | 38 public: |
39 virtual ~DownloadManagerDelegate(); | |
40 | |
41 // Lets the delegate know that the download manager is shutting down. | 39 // Lets the delegate know that the download manager is shutting down. |
42 virtual void Shutdown() {} | 40 virtual void Shutdown() {} |
43 | 41 |
44 // Returns a new DownloadId. | 42 // Returns a new DownloadId. |
45 virtual DownloadId GetNextId(); | 43 virtual DownloadId GetNextId(); |
46 | 44 |
47 // Notifies the delegate that a download is starting. The delegate can return | 45 // Notifies the delegate that a download is starting. The delegate can return |
48 // false to delay the start of the download, in which case it should call | 46 // false to delay the start of the download, in which case it should call |
49 // DownloadManager::RestartDownload when it's ready. | 47 // DownloadManager::RestartDownload when it's ready. |
50 virtual bool ShouldStartDownload(int32 download_id); | 48 virtual bool ShouldStartDownload(int32 download_id); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 bool* skip_dir_check) {} | 124 bool* skip_dir_check) {} |
127 | 125 |
128 // Asks the user for the path to save a page. The delegate calls the callback | 126 // Asks the user for the path to save a page. The delegate calls the callback |
129 // to give the answer. | 127 // to give the answer. |
130 virtual void ChooseSavePath(WebContents* web_contents, | 128 virtual void ChooseSavePath(WebContents* web_contents, |
131 const FilePath& suggested_path, | 129 const FilePath& suggested_path, |
132 const FilePath::StringType& default_extension, | 130 const FilePath::StringType& default_extension, |
133 bool can_save_as_complete, | 131 bool can_save_as_complete, |
134 const SavePackagePathPickedCallback& callback) { | 132 const SavePackagePathPickedCallback& callback) { |
135 } | 133 } |
| 134 |
| 135 protected: |
| 136 virtual ~DownloadManagerDelegate(); |
136 }; | 137 }; |
137 | 138 |
138 } // namespace content | 139 } // namespace content |
139 | 140 |
140 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 141 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |