OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // download has started, but the TabConetnts has gone away. This lets an | 47 // download has started, but the TabConetnts has gone away. This lets an |
48 // delegate return an alternative TabContents. The delegate can return NULL. | 48 // delegate return an alternative TabContents. The delegate can return NULL. |
49 virtual TabContents* GetAlternativeTabContentsToNotifyForDownload() = 0; | 49 virtual TabContents* GetAlternativeTabContentsToNotifyForDownload() = 0; |
50 | 50 |
51 // Tests if a file type should be opened automatically. | 51 // Tests if a file type should be opened automatically. |
52 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) = 0; | 52 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) = 0; |
53 | 53 |
54 // Allows the delegate to override completion of the download. If this | 54 // Allows the delegate to override completion of the download. If this |
55 // function returns false, the download completion is delayed and the | 55 // function returns false, the download completion is delayed and the |
56 // delegate is responsible for making sure that | 56 // delegate is responsible for making sure that |
57 // DownloadManager::MaybeCompleteDownload is called at some point in the | 57 // DownloadItem::MaybeCompleteDownload is called at some point in the |
58 // future. Note that at that point this function will be called again, | 58 // future. Note that at that point this function will be called again, |
59 // and is responsible for returning true when it really is ok for the | 59 // and is responsible for returning true when it really is ok for the |
60 // download to complete. | 60 // download to complete. |
61 virtual bool ShouldCompleteDownload(DownloadItem* item) = 0; | 61 virtual bool ShouldCompleteDownload(DownloadItem* item) = 0; |
62 | 62 |
63 // Allows the delegate to override opening the download. If this function | 63 // Allows the delegate to override opening the download. If this function |
64 // returns false, the delegate needs to call | 64 // returns false, the delegate needs to call |
65 // DownloadItem::DelayedDownloadOpened when it's done with the item, | 65 // DownloadItem::DelayedDownloadOpened when it's done with the item, |
66 // and is responsible for opening it. This function is called | 66 // and is responsible for opening it. This function is called |
67 // after the final rename, but before the download state is set to COMPLETED. | 67 // after the final rename, but before the download state is set to COMPLETED. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 116 |
117 protected: | 117 protected: |
118 DownloadManagerDelegate() {} | 118 DownloadManagerDelegate() {} |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegate); | 120 DISALLOW_COPY_AND_ASSIGN(DownloadManagerDelegate); |
121 }; | 121 }; |
122 | 122 |
123 } // namespace content | 123 } // namespace content |
124 | 124 |
125 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ | 125 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ |
OLD | NEW |