Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: content/public/browser/download_manager_delegate.h

Issue 11740026: Pull delegate check back into IsDownloadReadyForCompletion so that if (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed test. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 should only be called once per download. 88 // completion. This routine may be called multiple times; once it has
89 // returned true for a particular download it should continue to return
90 // true for that download.
89 virtual bool ShouldCompleteDownload( 91 virtual bool ShouldCompleteDownload(
90 DownloadItem* item, 92 DownloadItem* item,
91 const base::Closure& complete_callback); 93 const base::Closure& complete_callback);
92 94
93 // Allows the delegate to override opening the download. If this function 95 // Allows the delegate to override opening the download. If this function
94 // 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
95 // 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
96 // 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.
97 virtual bool ShouldOpenDownload(DownloadItem* item, 99 virtual bool ShouldOpenDownload(DownloadItem* item,
98 const DownloadOpenDelayedCallback& callback); 100 const DownloadOpenDelayedCallback& callback);
(...skipping 16 matching lines...) Expand all
115 const SavePackagePathPickedCallback& callback) { 117 const SavePackagePathPickedCallback& callback) {
116 } 118 }
117 119
118 protected: 120 protected:
119 virtual ~DownloadManagerDelegate(); 121 virtual ~DownloadManagerDelegate();
120 }; 122 };
121 123
122 } // namespace content 124 } // namespace content
123 125
124 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_ 126 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698