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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // download has started, but the TabConetnts has gone away. This lets an | 78 // download has started, but the TabConetnts has gone away. This lets an |
79 // delegate return an alternative WebContents. The delegate can return NULL. | 79 // delegate return an alternative WebContents. The delegate can return NULL. |
80 virtual WebContents* GetAlternativeWebContentsToNotifyForDownload(); | 80 virtual WebContents* GetAlternativeWebContentsToNotifyForDownload(); |
81 | 81 |
82 // Tests if a file type should be opened automatically. | 82 // Tests if a file type should be opened automatically. |
83 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path); | 83 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path); |
84 | 84 |
85 // Allows the delegate to delay completion of the download. This function | 85 // Allows the delegate to delay completion of the download. This function |
86 // will either return true (in which case the download may complete) | 86 // will either return true (in which case the download may complete) |
87 // or will call the callback passed when the download is ready for | 87 // or will call the callback passed when the download is ready for |
88 // completion. This routine may be called multiple times; once it has | 88 // completion. This routine may be called multiple times; once the callback |
89 // returned true for a particular download it should continue to return | 89 // has been called or the function has returned true for a particular |
90 // true for that download. | 90 // download it should continue to return true for that download. |
91 virtual bool ShouldCompleteDownload( | 91 virtual bool ShouldCompleteDownload( |
92 DownloadItem* item, | 92 DownloadItem* item, |
93 const base::Closure& complete_callback); | 93 const base::Closure& complete_callback); |
94 | 94 |
95 // Allows the delegate to override opening the download. If this function | 95 // Allows the delegate to override opening the download. If this function |
96 // returns false, the delegate needs to call callback when it's done | 96 // returns false, the delegate needs to call callback when it's done |
97 // with the item, and is responsible for opening it. This function is called | 97 // with the item, and is responsible for opening it. This function is called |
98 // after the final rename, but before the download state is set to COMPLETED. | 98 // after the final rename, but before the download state is set to COMPLETED. |
99 virtual bool ShouldOpenDownload(DownloadItem* item, | 99 virtual bool ShouldOpenDownload(DownloadItem* item, |
100 const DownloadOpenDelayedCallback& callback); | 100 const DownloadOpenDelayedCallback& callback); |
(...skipping 16 matching lines...) Expand all Loading... |
117 const SavePackagePathPickedCallback& callback) { | 117 const SavePackagePathPickedCallback& callback) { |
118 } | 118 } |
119 | 119 |
120 protected: | 120 protected: |
121 virtual ~DownloadManagerDelegate(); | 121 virtual ~DownloadManagerDelegate(); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace content | 124 } // namespace content |
125 | 125 |
126 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 126 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |