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_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
| 11 #include <string> |
| 12 |
10 #include "base/callback.h" | 13 #include "base/callback.h" |
11 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
12 #include "base/macros.h" | 15 #include "base/macros.h" |
13 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
14 #include "content/public/browser/download_danger_type.h" | 17 #include "content/public/browser/download_danger_type.h" |
| 18 #include "content/public/browser/download_interrupt_reasons.h" |
15 #include "content/public/browser/download_item.h" | 19 #include "content/public/browser/download_item.h" |
16 #include "content/public/browser/download_url_parameters.h" | 20 #include "content/public/browser/download_url_parameters.h" |
17 | 21 |
18 namespace content { | 22 namespace content { |
19 class DownloadItemImpl; | 23 class DownloadItemImpl; |
20 class BrowserContext; | 24 class BrowserContext; |
21 | 25 |
22 // Delegate for operations that a DownloadItemImpl can't do for itself. | 26 // Delegate for operations that a DownloadItemImpl can't do for itself. |
23 // The base implementation of this class does nothing (returning false | 27 // The base implementation of this class does nothing (returning false |
24 // on predicates) so interfaces not of interest to a derived class may | 28 // on predicates) so interfaces not of interest to a derived class may |
25 // be left unimplemented. | 29 // be left unimplemented. |
26 class CONTENT_EXPORT DownloadItemImplDelegate { | 30 class CONTENT_EXPORT DownloadItemImplDelegate { |
27 public: | 31 public: |
28 typedef base::Callback<void( | 32 typedef base::Callback<void( |
29 const base::FilePath&, // Target path | 33 const base::FilePath&, // Target path |
30 DownloadItem::TargetDisposition, // overwrite/uniquify target | 34 DownloadItem::TargetDisposition, // overwrite/uniquify target |
31 DownloadDangerType, | 35 DownloadDangerType, |
32 const base::FilePath& // Intermediate file path | 36 const base::FilePath&, // Intermediate file path |
33 )> DownloadTargetCallback; | 37 DownloadInterruptReason)> |
| 38 DownloadTargetCallback; |
34 | 39 |
35 // The boolean argument indicates whether or not the download was | 40 // The boolean argument indicates whether or not the download was |
36 // actually opened. | 41 // actually opened. |
37 typedef base::Callback<void(bool)> ShouldOpenDownloadCallback; | 42 typedef base::Callback<void(bool)> ShouldOpenDownloadCallback; |
38 | 43 |
39 DownloadItemImplDelegate(); | 44 DownloadItemImplDelegate(); |
40 virtual ~DownloadItemImplDelegate(); | 45 virtual ~DownloadItemImplDelegate(); |
41 | 46 |
42 // Used for catching use-after-free errors. | 47 // Used for catching use-after-free errors. |
43 void Attach(); | 48 void Attach(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 private: | 109 private: |
105 // For "Outlives attached DownloadItemImpl" invariant assertion. | 110 // For "Outlives attached DownloadItemImpl" invariant assertion. |
106 int count_; | 111 int count_; |
107 | 112 |
108 DISALLOW_COPY_AND_ASSIGN(DownloadItemImplDelegate); | 113 DISALLOW_COPY_AND_ASSIGN(DownloadItemImplDelegate); |
109 }; | 114 }; |
110 | 115 |
111 } // namespace content | 116 } // namespace content |
112 | 117 |
113 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ | 118 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ |
OLD | NEW |