| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/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/browser/download_item.h" | 12 #include "content/public/browser/download_item.h" |
| 13 #include "content/public/browser/download_url_parameters.h" | 13 #include "content/public/browser/download_url_parameters.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 class DownloadItemImpl; | 16 class DownloadItemImpl; |
| 17 class BrowserContext; | 17 class BrowserContext; |
| 18 | 18 |
| 19 // Delegate for operations that a DownloadItemImpl can't do for itself. | 19 // Delegate for operations that a DownloadItemImpl can't do for itself. |
| 20 // The base implementation of this class does nothing (returning false | 20 // The base implementation of this class does nothing (returning false |
| 21 // on predicates) so interfaces not of interest to a derived class may | 21 // on predicates) so interfaces not of interest to a derived class may |
| 22 // be left unimplemented. | 22 // be left unimplemented. |
| 23 class CONTENT_EXPORT DownloadItemImplDelegate { | 23 class CONTENT_EXPORT DownloadItemImplDelegate { |
| 24 public: | 24 public: |
| 25 typedef base::Callback<void( | 25 typedef base::Callback<void( |
| 26 const base::FilePath&, // Target path | 26 const base::FilePath&, // Target path |
| 27 DownloadItem::TargetDisposition, // overwrite/uniquify target | 27 DownloadItem::TargetDisposition, // overwrite/uniquify target |
| 28 DownloadDangerType, | 28 DownloadDangerType, |
| 29 const base::FilePath& // Intermediate file path | 29 const base::FilePath&, // Intermediate file path |
| 30 )> DownloadTargetCallback; | 30 bool hide_file_extension )> DownloadTargetCallback; |
| 31 | 31 |
| 32 // The boolean argument indicates whether or not the download was | 32 // The boolean argument indicates whether or not the download was |
| 33 // actually opened. | 33 // actually opened. |
| 34 typedef base::Callback<void(bool)> ShouldOpenDownloadCallback; | 34 typedef base::Callback<void(bool)> ShouldOpenDownloadCallback; |
| 35 | 35 |
| 36 DownloadItemImplDelegate(); | 36 DownloadItemImplDelegate(); |
| 37 virtual ~DownloadItemImplDelegate(); | 37 virtual ~DownloadItemImplDelegate(); |
| 38 | 38 |
| 39 // Used for catching use-after-free errors. | 39 // Used for catching use-after-free errors. |
| 40 void Attach(); | 40 void Attach(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 private: | 93 private: |
| 94 // For "Outlives attached DownloadItemImpl" invariant assertion. | 94 // For "Outlives attached DownloadItemImpl" invariant assertion. |
| 95 int count_; | 95 int count_; |
| 96 | 96 |
| 97 DISALLOW_COPY_AND_ASSIGN(DownloadItemImplDelegate); | 97 DISALLOW_COPY_AND_ASSIGN(DownloadItemImplDelegate); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 } // namespace content | 100 } // namespace content |
| 101 | 101 |
| 102 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ | 102 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ |
| OLD | NEW |