OLD | NEW |
1 | 1 |
2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "chrome/browser/download/download_state_info.h" | 6 #include "chrome/browser/download/download_state_info.h" |
7 | 7 |
8 #include "chrome/browser/download/download_item.h" | 8 #include "chrome/browser/download/download_item.h" |
9 | 9 |
10 DownloadStateInfo::DownloadStateInfo() | 10 DownloadStateInfo::DownloadStateInfo() |
11 : path_uniquifier(0), | 11 : path_uniquifier(0), |
12 has_user_gesture(false), | 12 has_user_gesture(false), |
13 prompt_user_for_save_location(false), | 13 prompt_user_for_save_location(false), |
14 is_dangerous_file(false), | 14 is_dangerous_file(false), |
15 is_dangerous_url(false), | 15 is_dangerous_url(UNKNOWN), |
| 16 visited_referrer_before(UNKNOWN), |
16 is_extension_install(false) { | 17 is_extension_install(false) { |
17 } | 18 } |
18 | 19 |
19 DownloadStateInfo::DownloadStateInfo( | 20 DownloadStateInfo::DownloadStateInfo( |
20 bool has_user_gesture, | 21 bool has_user_gesture, |
21 bool prompt_user_for_save_location) | 22 bool prompt_user_for_save_location) |
22 : path_uniquifier(0), | 23 : path_uniquifier(0), |
23 has_user_gesture(has_user_gesture), | 24 has_user_gesture(has_user_gesture), |
24 prompt_user_for_save_location(prompt_user_for_save_location), | 25 prompt_user_for_save_location(prompt_user_for_save_location), |
25 is_dangerous_file(false), | 26 is_dangerous_file(false), |
26 is_dangerous_url(false), | 27 is_dangerous_url(UNKNOWN), |
| 28 visited_referrer_before(UNKNOWN), |
27 is_extension_install(false) { | 29 is_extension_install(false) { |
28 } | 30 } |
29 | 31 |
30 DownloadStateInfo::DownloadStateInfo( | 32 DownloadStateInfo::DownloadStateInfo( |
31 const FilePath& target, | 33 const FilePath& target, |
32 const FilePath& forced_name, | 34 const FilePath& forced_name, |
33 bool has_user_gesture, | 35 bool has_user_gesture, |
34 bool prompt_user_for_save_location, | 36 bool prompt_user_for_save_location, |
35 int uniquifier, | 37 int uniquifier, |
36 bool dangerous_file, | 38 bool dangerous_file, |
37 bool dangerous_url, | 39 Tristate dangerous_url, |
| 40 Tristate visited_referrer_before, |
38 bool extension_install) | 41 bool extension_install) |
39 : target_name(target), | 42 : target_name(target), |
40 path_uniquifier(uniquifier), | 43 path_uniquifier(uniquifier), |
41 has_user_gesture(has_user_gesture), | 44 has_user_gesture(has_user_gesture), |
42 prompt_user_for_save_location(prompt_user_for_save_location), | 45 prompt_user_for_save_location(prompt_user_for_save_location), |
43 is_dangerous_file(dangerous_file), | 46 is_dangerous_file(dangerous_file), |
44 is_dangerous_url(dangerous_url), | 47 is_dangerous_url(dangerous_url), |
| 48 visited_referrer_before(visited_referrer_before), |
45 is_extension_install(extension_install), | 49 is_extension_install(extension_install), |
46 force_file_name(forced_name) { | 50 force_file_name(forced_name) { |
47 } | 51 } |
48 | 52 |
49 bool DownloadStateInfo::IsDangerous() const { | 53 bool DownloadStateInfo::IsDangerous() const { |
50 return is_dangerous_url || is_dangerous_file; | 54 return (is_dangerous_url == YES) || is_dangerous_file; |
51 } | 55 } |
OLD | NEW |