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

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

Issue 8697006: DownloadManager intereface refactoring to allow cleaner DownloadItem unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added CONTENT_EXPORT to delegate. Created 9 years 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/save_package.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) 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
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
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_
OLDNEW
« no previous file with comments | « content/browser/download/save_package.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698