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_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // | 67 // |
68 // The state of the |item| shouldn't be modified during the process of | 68 // The state of the |item| shouldn't be modified during the process of |
69 // filename determination save for external data (GetExternalData() / | 69 // filename determination save for external data (GetExternalData() / |
70 // SetExternalData()). | 70 // SetExternalData()). |
71 // | 71 // |
72 // If the download should be canceled, |callback| should be invoked with an | 72 // If the download should be canceled, |callback| should be invoked with an |
73 // empty |target_path| argument. | 73 // empty |target_path| argument. |
74 virtual bool DetermineDownloadTarget(DownloadItem* item, | 74 virtual bool DetermineDownloadTarget(DownloadItem* item, |
75 const DownloadTargetCallback& callback); | 75 const DownloadTargetCallback& callback); |
76 | 76 |
77 // Called when the download system wants to alert a WebContents that a | |
78 // download has started, but the TabConetnts has gone away. This lets an | |
79 // delegate return an alternative WebContents. The delegate can return NULL. | |
80 virtual WebContents* GetAlternativeWebContentsToNotifyForDownload(); | |
81 | |
82 // Tests if a file type should be opened automatically. | 77 // Tests if a file type should be opened automatically. |
83 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path); | 78 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path); |
84 | 79 |
85 // Allows the delegate to delay completion of the download. This function | 80 // Allows the delegate to delay completion of the download. This function |
86 // will either return true (in which case the download may complete) | 81 // will either return true (in which case the download may complete) |
87 // or will call the callback passed when the download is ready for | 82 // or will call the callback passed when the download is ready for |
88 // completion. This routine should only be called once per download. | 83 // completion. This routine should only be called once per download. |
89 virtual bool ShouldCompleteDownload( | 84 virtual bool ShouldCompleteDownload( |
90 DownloadItem* item, | 85 DownloadItem* item, |
91 const base::Closure& complete_callback); | 86 const base::Closure& complete_callback); |
(...skipping 23 matching lines...) Expand all Loading... |
115 const SavePackagePathPickedCallback& callback) { | 110 const SavePackagePathPickedCallback& callback) { |
116 } | 111 } |
117 | 112 |
118 protected: | 113 protected: |
119 virtual ~DownloadManagerDelegate(); | 114 virtual ~DownloadManagerDelegate(); |
120 }; | 115 }; |
121 | 116 |
122 } // namespace content | 117 } // namespace content |
123 | 118 |
124 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 119 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |