Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: content/public/browser/download_manager_delegate.h

Issue 2060923002: Neutralize dangerous subresource files during Save Page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@save-package-cleanup-1
Patch Set: Catch up with ToT Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/download/save_package_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « content/browser/download/save_package_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698