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