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

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: Reword note in README.md Created 4 years, 6 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 a subresource of a
jam 2016/06/16 23:13:06 should SavePackage be in the method name to make i
asanka 2016/06/21 15:39:38 Done.
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->DirName()| must be the same both before and after the call.
jam 2016/06/16 23:13:06 why not just pass in a file name that doesn't incl
asanka 2016/06/21 15:39:38 Done. This was already the case, but I've commente
130 virtual void SanitizeSaveItemFilename(base::FilePath* filename) {}
131
122 // Opens the file associated with this download. 132 // Opens the file associated with this download.
123 virtual void OpenDownload(DownloadItem* download) {} 133 virtual void OpenDownload(DownloadItem* download) {}
124 134
125 // Shows the download via the OS shell. 135 // Shows the download via the OS shell.
126 virtual void ShowDownloadInShell(DownloadItem* download) {} 136 virtual void ShowDownloadInShell(DownloadItem* download) {}
127 137
128 // Checks whether a downloaded file still exists. 138 // Checks whether a downloaded file still exists.
129 virtual void CheckForFileExistence( 139 virtual void CheckForFileExistence(
130 DownloadItem* download, 140 DownloadItem* download,
131 const CheckForFileExistenceCallback& callback) {} 141 const CheckForFileExistenceCallback& callback) {}
132 142
133 // Return a GUID string used for identifying the application to the 143 // Return a GUID string used for identifying the application to the
134 // system AV function for scanning downloaded files. If an empty 144 // system AV function for scanning downloaded files. If an empty
135 // or invalid GUID string is returned, no client identification 145 // or invalid GUID string is returned, no client identification
136 // will be given to the AV function. 146 // will be given to the AV function.
137 virtual std::string ApplicationClientIdForFileScanning() const; 147 virtual std::string ApplicationClientIdForFileScanning() const;
138 148
139 protected: 149 protected:
140 virtual ~DownloadManagerDelegate(); 150 virtual ~DownloadManagerDelegate();
141 }; 151 };
142 152
143 } // namespace content 153 } // namespace content
144 154
145 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ 155 #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