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