OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 // | |
Paweł Hajdan Jr.
2011/05/23 14:04:23
nit: Remove this line.
| |
5 | |
6 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_STATE_INFO_H_ | |
7 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_STATE_INFO_H_ | |
8 #pragma once | |
9 | |
10 #include "base/file_path.h" | |
11 | |
12 // Contains information relating to the process of determining what to do with | |
13 // the download. | |
14 struct DownloadStateInfo { | |
15 DownloadStateInfo(); | |
16 DownloadStateInfo(bool has_user_gesture, | |
17 bool prompt_user_for_save_location); | |
18 DownloadStateInfo(const FilePath& target, | |
19 const FilePath& forced_name, | |
20 bool has_user_gesture, | |
21 bool prompt_user_for_save_location, | |
22 int uniquifier, | |
23 bool dangerous_file, | |
24 bool dangerous_url, | |
25 bool extension_install); | |
26 | |
27 // Indicates if the download is dangerous. | |
28 bool IsDangerous() const; | |
29 | |
30 // The original name for a dangerous download, specified by the request. | |
31 FilePath target_name; | |
32 | |
33 // The path where we save the download. Typically generated. | |
34 FilePath suggested_path; | |
35 | |
36 // A number that should be added to the suggested path to make it unique. | |
37 // 0 means no number should be appended. It is eventually incorporated | |
38 // into the final file name. | |
39 int path_uniquifier; | |
40 | |
41 // True if the download is the result of user action. | |
42 bool has_user_gesture; | |
43 | |
44 // True if we should display the 'save as...' UI and prompt the user | |
45 // for the download location. | |
46 // False if the UI should be suppressed and the download performed to the | |
47 // default location. | |
48 bool prompt_user_for_save_location; | |
49 | |
50 // True if this download file is potentially dangerous (ex: exe, dll, ...). | |
51 bool is_dangerous_file; | |
52 | |
53 // If safebrowsing believes this URL leads to malware. | |
54 bool is_dangerous_url; | |
55 | |
56 // True if this download is for extension install. | |
57 bool is_extension_install; | |
58 | |
59 // True if this download's file name was specified initially. | |
60 FilePath force_file_name; | |
61 }; | |
62 | |
63 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_STATE_INFO_H_ | |
OLD | NEW |