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