| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // operation. | 288 // operation. |
| 289 bool HasPromptedForPath() const; | 289 bool HasPromptedForPath() const; |
| 290 | 290 |
| 291 // Returns true if this download should show the "dangerous file" warning. | 291 // Returns true if this download should show the "dangerous file" warning. |
| 292 // Various factors are considered, such as the type of the file, whether a | 292 // Various factors are considered, such as the type of the file, whether a |
| 293 // user action initiated the download, and whether the user has explicitly | 293 // user action initiated the download, and whether the user has explicitly |
| 294 // marked the file type as "auto open". Protected virtual for testing. | 294 // marked the file type as "auto open". Protected virtual for testing. |
| 295 bool IsDangerousFile(PriorVisitsToReferrer visits); | 295 bool IsDangerousFile(PriorVisitsToReferrer visits); |
| 296 | 296 |
| 297 // content::DownloadItem::Observer | 297 // content::DownloadItem::Observer |
| 298 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; | 298 virtual void OnDownloadDestroyed(content::DownloadItem* download) override; |
| 299 | 299 |
| 300 // state | 300 // state |
| 301 State next_state_; | 301 State next_state_; |
| 302 bool should_prompt_; | 302 bool should_prompt_; |
| 303 bool should_notify_extensions_; | 303 bool should_notify_extensions_; |
| 304 bool create_target_directory_; | 304 bool create_target_directory_; |
| 305 DownloadPathReservationTracker::FilenameConflictAction conflict_action_; | 305 DownloadPathReservationTracker::FilenameConflictAction conflict_action_; |
| 306 content::DownloadDangerType danger_type_; | 306 content::DownloadDangerType danger_type_; |
| 307 bool is_dangerous_file_; // See DownloadTargetInfo::is_dangerous_file | 307 bool is_dangerous_file_; // See DownloadTargetInfo::is_dangerous_file |
| 308 base::FilePath virtual_path_; | 308 base::FilePath virtual_path_; |
| 309 base::FilePath local_path_; | 309 base::FilePath local_path_; |
| 310 base::FilePath intermediate_path_; | 310 base::FilePath intermediate_path_; |
| 311 std::string mime_type_; | 311 std::string mime_type_; |
| 312 bool is_filetype_handled_safely_; | 312 bool is_filetype_handled_safely_; |
| 313 | 313 |
| 314 content::DownloadItem* download_; | 314 content::DownloadItem* download_; |
| 315 const bool is_resumption_; | 315 const bool is_resumption_; |
| 316 DownloadPrefs* download_prefs_; | 316 DownloadPrefs* download_prefs_; |
| 317 DownloadTargetDeterminerDelegate* delegate_; | 317 DownloadTargetDeterminerDelegate* delegate_; |
| 318 CompletionCallback completion_callback_; | 318 CompletionCallback completion_callback_; |
| 319 base::CancelableTaskTracker history_tracker_; | 319 base::CancelableTaskTracker history_tracker_; |
| 320 | 320 |
| 321 base::WeakPtrFactory<DownloadTargetDeterminer> weak_ptr_factory_; | 321 base::WeakPtrFactory<DownloadTargetDeterminer> weak_ptr_factory_; |
| 322 | 322 |
| 323 DISALLOW_COPY_AND_ASSIGN(DownloadTargetDeterminer); | 323 DISALLOW_COPY_AND_ASSIGN(DownloadTargetDeterminer); |
| 324 }; | 324 }; |
| 325 | 325 |
| 326 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_H_ | 326 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TARGET_DETERMINER_H_ |
| OLD | NEW |