| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 FilePath* download_save_dir) {} | 121 FilePath* download_save_dir) {} |
| 124 | 122 |
| 125 // Asks the user for the path to save a page. The delegate calls the callback | 123 // Asks the user for the path to save a page. The delegate calls the callback |
| 126 // to give the answer. | 124 // to give the answer. |
| 127 virtual void ChooseSavePath(WebContents* web_contents, | 125 virtual void ChooseSavePath(WebContents* web_contents, |
| 128 const FilePath& suggested_path, | 126 const FilePath& suggested_path, |
| 129 const FilePath::StringType& default_extension, | 127 const FilePath::StringType& default_extension, |
| 130 bool can_save_as_complete, | 128 bool can_save_as_complete, |
| 131 const SavePackagePathPickedCallback& callback) { | 129 const SavePackagePathPickedCallback& callback) { |
| 132 } | 130 } |
| 131 |
| 132 protected: |
| 133 virtual ~DownloadManagerDelegate(); |
| 133 }; | 134 }; |
| 134 | 135 |
| 135 } // namespace content | 136 } // namespace content |
| 136 | 137 |
| 137 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 138 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
| OLD | NEW |