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

Side by Side Diff: chrome/browser/download/download_target_info.h

Issue 1982723002: Use FileTypePolicies for download danger classifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use_policies
Patch Set: Fix bad rebase Created 4 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_INFO_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_INFO_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_INFO_H_ 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_INFO_H_
7 7
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "chrome/browser/download/download_extensions.h" 9 #include "chrome/common/safe_browsing/download_file_types.pb.h"
10 #include "content/public/browser/download_danger_type.h" 10 #include "content/public/browser/download_danger_type.h"
11 #include "content/public/browser/download_item.h" 11 #include "content/public/browser/download_item.h"
12 12
13 struct DownloadTargetInfo { 13 struct DownloadTargetInfo {
14 DownloadTargetInfo(); 14 DownloadTargetInfo();
15 ~DownloadTargetInfo(); 15 ~DownloadTargetInfo();
16 16
17 // Final full target path of the download. Must be non-empty for the remaining 17 // Final full target path of the download. Must be non-empty for the remaining
18 // fields to be considered valid. The path is a local file system path. Any 18 // fields to be considered valid. The path is a local file system path. Any
19 // existing file at this path should be overwritten. 19 // existing file at this path should be overwritten.
(...skipping 24 matching lines...) Expand all
44 // 44 //
45 // ALLOW_ON_USER_GESTURE : If SafeBrowsing claims the file is safe, then the 45 // ALLOW_ON_USER_GESTURE : If SafeBrowsing claims the file is safe, then the
46 // file is safe. An UNKOWN verdict results in the file being marked as 46 // file is safe. An UNKOWN verdict results in the file being marked as
47 // DANGEROUS_FILE. 47 // DANGEROUS_FILE.
48 // 48 //
49 // DANGEROUS : This type of file shouldn't be allowed to download witout any 49 // DANGEROUS : This type of file shouldn't be allowed to download witout any
50 // user action. Hence, if SafeBrowsing marks the file as SAFE, or 50 // user action. Hence, if SafeBrowsing marks the file as SAFE, or
51 // UNKONWN, the file will still be conisdered a DANGEROUS_FILE. However, 51 // UNKONWN, the file will still be conisdered a DANGEROUS_FILE. However,
52 // SafeBrowsing may flag the file as being malicious, in which case the 52 // SafeBrowsing may flag the file as being malicious, in which case the
53 // malicious classification should take precedence. 53 // malicious classification should take precedence.
54 download_util::DownloadDangerLevel danger_level; 54 safe_browsing::DownloadFileType::DangerLevel danger_level;
55 55
56 // Suggested intermediate path. The downloaded bytes should be written to this 56 // Suggested intermediate path. The downloaded bytes should be written to this
57 // path until all the bytes are available and the user has accepted a 57 // path until all the bytes are available and the user has accepted a
58 // dangerous download. At that point, the download can be renamed to 58 // dangerous download. At that point, the download can be renamed to
59 // |target_path|. 59 // |target_path|.
60 base::FilePath intermediate_path; 60 base::FilePath intermediate_path;
61 61
62 // MIME type based on the file type of the download. This may be different 62 // MIME type based on the file type of the download. This may be different
63 // from DownloadItem::GetMimeType() since the latter is based on the server 63 // from DownloadItem::GetMimeType() since the latter is based on the server
64 // response, and this one is based on the filename. 64 // response, and this one is based on the filename.
65 std::string mime_type; 65 std::string mime_type;
66 66
67 // Whether the |target_path| would be handled safely by the browser if it were 67 // Whether the |target_path| would be handled safely by the browser if it were
68 // to be opened with a file:// URL. This can be used later to decide how file 68 // to be opened with a file:// URL. This can be used later to decide how file
69 // opens should be handled. The file is considered to be handled safely if the 69 // opens should be handled. The file is considered to be handled safely if the
70 // filetype is supported by the renderer or a sandboxed plugin. 70 // filetype is supported by the renderer or a sandboxed plugin.
71 bool is_filetype_handled_safely; 71 bool is_filetype_handled_safely;
72 }; 72 };
73 73
74 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_INFO_H_ 74 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_INFO_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_target_determiner_unittest.cc ('k') | chrome/browser/resources/safe_browsing/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698