| OLD | NEW |
| 1 // Copyright (c) 2012 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_ITEM_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 17 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 18 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 19 #include "content/browser/download/download_destination_observer.h" | 20 #include "content/browser/download/download_destination_observer.h" |
| 20 #include "content/browser/download/download_net_log_parameters.h" | 21 #include "content/browser/download/download_net_log_parameters.h" |
| 21 #include "content/browser/download/download_request_handle.h" | 22 #include "content/browser/download/download_request_handle.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 | 400 |
| 400 // Called when the target path has been determined. |target_path| is the | 401 // Called when the target path has been determined. |target_path| is the |
| 401 // suggested target path. |disposition| indicates how the target path should | 402 // suggested target path. |disposition| indicates how the target path should |
| 402 // be used (see TargetDisposition). |danger_type| is the danger level of | 403 // be used (see TargetDisposition). |danger_type| is the danger level of |
| 403 // |target_path| as determined by the caller. |intermediate_path| is the path | 404 // |target_path| as determined by the caller. |intermediate_path| is the path |
| 404 // to use to store the download until OnDownloadCompleting() is called. | 405 // to use to store the download until OnDownloadCompleting() is called. |
| 405 virtual void OnDownloadTargetDetermined( | 406 virtual void OnDownloadTargetDetermined( |
| 406 const base::FilePath& target_path, | 407 const base::FilePath& target_path, |
| 407 TargetDisposition disposition, | 408 TargetDisposition disposition, |
| 408 DownloadDangerType danger_type, | 409 DownloadDangerType danger_type, |
| 409 const base::FilePath& intermediate_path); | 410 const base::FilePath& intermediate_path, |
| 411 DownloadInterruptReason interrupt_reason); |
| 410 | 412 |
| 411 void OnDownloadRenamedToIntermediateName( | 413 void OnDownloadRenamedToIntermediateName( |
| 412 DownloadInterruptReason reason, const base::FilePath& full_path); | 414 DownloadInterruptReason reason, const base::FilePath& full_path); |
| 413 | 415 |
| 414 // If all pre-requisites have been met, complete download processing, i.e. do | 416 // If all pre-requisites have been met, complete download processing, i.e. do |
| 415 // internal cleanup, file rename, and potentially auto-open. (Dangerous | 417 // internal cleanup, file rename, and potentially auto-open. (Dangerous |
| 416 // downloads still may block on user acceptance after this point.) | 418 // downloads still may block on user acceptance after this point.) |
| 417 void MaybeCompleteDownload(); | 419 void MaybeCompleteDownload(); |
| 418 | 420 |
| 419 // Called when the download is ready to complete. | 421 // Called when the download is ready to complete. |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 const net::NetLogWithSource net_log_; | 679 const net::NetLogWithSource net_log_; |
| 678 | 680 |
| 679 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; | 681 base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_; |
| 680 | 682 |
| 681 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); | 683 DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl); |
| 682 }; | 684 }; |
| 683 | 685 |
| 684 } // namespace content | 686 } // namespace content |
| 685 | 687 |
| 686 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ | 688 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_H_ |
| OLD | NEW |