| 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 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // | 64 // |
| 65 // The state of the |item| shouldn't be modified during the process of | 65 // The state of the |item| shouldn't be modified during the process of |
| 66 // filename determination save for external data (GetExternalData() / | 66 // filename determination save for external data (GetExternalData() / |
| 67 // SetExternalData()). | 67 // SetExternalData()). |
| 68 // | 68 // |
| 69 // If the download should be canceled, |callback| should be invoked with an | 69 // If the download should be canceled, |callback| should be invoked with an |
| 70 // empty |target_path| argument. | 70 // empty |target_path| argument. |
| 71 virtual bool DetermineDownloadTarget(DownloadItem* item, | 71 virtual bool DetermineDownloadTarget(DownloadItem* item, |
| 72 const DownloadTargetCallback& callback); | 72 const DownloadTargetCallback& callback); |
| 73 | 73 |
| 74 // Gets the intermediate file's length. |
| 75 // |path| is the final name of the file, unless |temporary| is true, in which |
| 76 // case |path| is the temporary file name. |
| 77 virtual int64 GetIntermediateFileLength(const FilePath& path, |
| 78 bool temporary); |
| 79 |
| 74 // Called when the download system wants to alert a WebContents that a | 80 // Called when the download system wants to alert a WebContents that a |
| 75 // download has started, but the TabConetnts has gone away. This lets an | 81 // download has started, but the TabConetnts has gone away. This lets an |
| 76 // delegate return an alternative WebContents. The delegate can return NULL. | 82 // delegate return an alternative WebContents. The delegate can return NULL. |
| 77 virtual WebContents* GetAlternativeWebContentsToNotifyForDownload(); | 83 virtual WebContents* GetAlternativeWebContentsToNotifyForDownload(); |
| 78 | 84 |
| 79 // Tests if a file type should be opened automatically. | 85 // Tests if a file type should be opened automatically. |
| 80 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path); | 86 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path); |
| 81 | 87 |
| 82 // Allows the delegate to delay completion of the download. This function | 88 // Allows the delegate to delay completion of the download. This function |
| 83 // will either return true (in which case the download is ready to complete) | 89 // will either return true (in which case the download is ready to complete) |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 const SavePackagePathPickedCallback& callback) { | 149 const SavePackagePathPickedCallback& callback) { |
| 144 } | 150 } |
| 145 | 151 |
| 146 protected: | 152 protected: |
| 147 virtual ~DownloadManagerDelegate(); | 153 virtual ~DownloadManagerDelegate(); |
| 148 }; | 154 }; |
| 149 | 155 |
| 150 } // namespace content | 156 } // namespace content |
| 151 | 157 |
| 152 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 158 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
| OLD | NEW |