| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/public/browser/download_danger_type.h" | 11 #include "content/public/browser/download_danger_type.h" |
| 12 #include "content/public/common/page_transition_types.h" | 12 #include "content/public/common/page_transition_types.h" |
| 13 | 13 |
| 14 // Contains information relating to the process of determining what to do with | 14 // Contains information relating to the process of determining what to do with |
| 15 // the download. | 15 // the download. |
| 16 struct DownloadStateInfo { | 16 struct DownloadStateInfo { |
| 17 DownloadStateInfo(); | 17 DownloadStateInfo(); |
| 18 DownloadStateInfo(bool has_user_gesture, | 18 DownloadStateInfo(const FilePath& forced_name, |
| 19 bool prompt_user_for_save_location); | |
| 20 DownloadStateInfo(const FilePath& target, | |
| 21 const FilePath& forced_name, | |
| 22 bool has_user_gesture, | 19 bool has_user_gesture, |
| 23 content::PageTransition transition_type, | 20 content::PageTransition transition_type, |
| 24 bool prompt_user_for_save_location); | 21 bool prompt_user_for_save_location); |
| 25 | 22 |
| 26 // Indicates if the download is dangerous. | 23 // Indicates if the download is dangerous. |
| 27 CONTENT_EXPORT bool IsDangerous() const; | 24 CONTENT_EXPORT bool IsDangerous() const; |
| 28 | 25 |
| 29 // The original name for a dangerous download, specified by the request. | 26 // The original name for a dangerous download, specified by the request. |
| 30 FilePath target_name; | 27 FilePath target_name; |
| 31 | 28 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 43 content::PageTransition transition_type; | 40 content::PageTransition transition_type; |
| 44 | 41 |
| 45 // True if we should display the 'save as...' UI and prompt the user | 42 // True if we should display the 'save as...' UI and prompt the user |
| 46 // for the download location. | 43 // for the download location. |
| 47 // False if the UI should be suppressed and the download performed to the | 44 // False if the UI should be suppressed and the download performed to the |
| 48 // default location. | 45 // default location. |
| 49 bool prompt_user_for_save_location; | 46 bool prompt_user_for_save_location; |
| 50 | 47 |
| 51 content::DownloadDangerType danger; | 48 content::DownloadDangerType danger; |
| 52 | 49 |
| 53 // True if this download's file name was specified initially. | 50 // If non-empty, contains an externally supplied filename that should be used |
| 51 // as the target path. |
| 54 FilePath force_file_name; | 52 FilePath force_file_name; |
| 55 }; | 53 }; |
| 56 | 54 |
| 57 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATE_INFO_H_ | 55 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_STATE_INFO_H_ |
| OLD | NEW |