| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // Asks the user for the path to save a page. The delegate calls the callback | 112 // Asks the user for the path to save a page. The delegate calls the callback |
| 113 // to give the answer. | 113 // to give the answer. |
| 114 virtual void ChooseSavePath( | 114 virtual void ChooseSavePath( |
| 115 WebContents* web_contents, | 115 WebContents* web_contents, |
| 116 const base::FilePath& suggested_path, | 116 const base::FilePath& suggested_path, |
| 117 const base::FilePath::StringType& default_extension, | 117 const base::FilePath::StringType& default_extension, |
| 118 bool can_save_as_complete, | 118 bool can_save_as_complete, |
| 119 const SavePackagePathPickedCallback& callback) { | 119 const SavePackagePathPickedCallback& callback) { |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Sanitize a filename that's going to be used for saving a subresource of a |
| 123 // SavePackage. |
| 124 // |
| 125 // If the delegate does nothing, the default filename already populated in |
| 126 // |filename| will be used. Otherwise, the delegate can update |filename| to |
| 127 // the desired filename. |
| 128 // |
| 129 // |filename| contains a basename with an extension, but without a path. This |
| 130 // should be the case on return as well. I.e. |filename| cannot specify a |
| 131 // relative path. |
| 132 virtual void SanitizeSavePackageResourceName(base::FilePath* filename) {} |
| 133 |
| 122 // Opens the file associated with this download. | 134 // Opens the file associated with this download. |
| 123 virtual void OpenDownload(DownloadItem* download) {} | 135 virtual void OpenDownload(DownloadItem* download) {} |
| 124 | 136 |
| 125 // Shows the download via the OS shell. | 137 // Shows the download via the OS shell. |
| 126 virtual void ShowDownloadInShell(DownloadItem* download) {} | 138 virtual void ShowDownloadInShell(DownloadItem* download) {} |
| 127 | 139 |
| 128 // Checks whether a downloaded file still exists. | 140 // Checks whether a downloaded file still exists. |
| 129 virtual void CheckForFileExistence( | 141 virtual void CheckForFileExistence( |
| 130 DownloadItem* download, | 142 DownloadItem* download, |
| 131 const CheckForFileExistenceCallback& callback) {} | 143 const CheckForFileExistenceCallback& callback) {} |
| 132 | 144 |
| 133 // Return a GUID string used for identifying the application to the | 145 // Return a GUID string used for identifying the application to the |
| 134 // system AV function for scanning downloaded files. If an empty | 146 // system AV function for scanning downloaded files. If an empty |
| 135 // or invalid GUID string is returned, no client identification | 147 // or invalid GUID string is returned, no client identification |
| 136 // will be given to the AV function. | 148 // will be given to the AV function. |
| 137 virtual std::string ApplicationClientIdForFileScanning() const; | 149 virtual std::string ApplicationClientIdForFileScanning() const; |
| 138 | 150 |
| 139 protected: | 151 protected: |
| 140 virtual ~DownloadManagerDelegate(); | 152 virtual ~DownloadManagerDelegate(); |
| 141 }; | 153 }; |
| 142 | 154 |
| 143 } // namespace content | 155 } // namespace content |
| 144 | 156 |
| 145 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 157 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
| OLD | NEW |