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

Side by Side Diff: content/browser/download/download_item_impl_delegate.h

Issue 10831302: Download resumption - Preliminary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed signed/unsigned compare issue. Created 8 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
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_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "content/public/browser/download_danger_type.h" 11 #include "content/public/browser/download_danger_type.h"
12 #include "content/public/browser/download_item.h" 12 #include "content/public/browser/download_item.h"
13 #include "content/public/browser/download_url_parameters.h"
13 14
14 namespace content { 15 namespace content {
15 class DownloadItemImpl; 16 class DownloadItemImpl;
16 class BrowserContext; 17 class BrowserContext;
17 18
18 // Delegate for operations that a DownloadItemImpl can't do for itself. 19 // Delegate for operations that a DownloadItemImpl can't do for itself.
19 // The base implementation of this class does nothing (returning false 20 // The base implementation of this class does nothing (returning false
20 // on predicates) so interfaces not of interest to a derived class may 21 // on predicates) so interfaces not of interest to a derived class may
21 // be left unimplemented. 22 // be left unimplemented.
22 class CONTENT_EXPORT DownloadItemImplDelegate { 23 class CONTENT_EXPORT DownloadItemImplDelegate {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 60
60 // Tests if a file type should be opened automatically. 61 // Tests if a file type should be opened automatically.
61 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path); 62 virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path);
62 63
63 // Checks whether a downloaded file still exists and updates the 64 // Checks whether a downloaded file still exists and updates the
64 // file's state if the file is already removed. 65 // file's state if the file is already removed.
65 // The check may or may not result in a later asynchronous call 66 // The check may or may not result in a later asynchronous call
66 // to OnDownloadedFileRemoved(). 67 // to OnDownloadedFileRemoved().
67 virtual void CheckForFileRemoval(DownloadItemImpl* download_item); 68 virtual void CheckForFileRemoval(DownloadItemImpl* download_item);
68 69
70 // Called when an interrupted download is resumed.
71 virtual void ResumeInterruptedDownload(
72 scoped_ptr<content::DownloadUrlParameters> params,
73 content::DownloadId id);
74
69 // For contextual issues like language and prefs. 75 // For contextual issues like language and prefs.
70 virtual BrowserContext* GetBrowserContext() const; 76 virtual BrowserContext* GetBrowserContext() const;
71 77
72 // Update the persistent store with our information. 78 // Update the persistent store with our information.
73 virtual void UpdatePersistence(DownloadItemImpl* download); 79 virtual void UpdatePersistence(DownloadItemImpl* download);
74 80
75 // Handle any delegate portions of a state change operation on the 81 // Handle any delegate portions of a state change operation on the
76 // DownloadItem. 82 // DownloadItem.
77 virtual void DownloadStopped(DownloadItemImpl* download); 83 virtual void DownloadStopped(DownloadItemImpl* download);
78 virtual void DownloadCompleted(DownloadItemImpl* download); 84 virtual void DownloadCompleted(DownloadItemImpl* download);
79 virtual void DownloadOpened(DownloadItemImpl* download); 85 virtual void DownloadOpened(DownloadItemImpl* download);
80 virtual void DownloadRemoved(DownloadItemImpl* download); 86 virtual void DownloadRemoved(DownloadItemImpl* download);
81 87
82 // Show the download in the browser. 88 // Show the download in the browser.
83 virtual void ShowDownloadInBrowser(DownloadItemImpl* download); 89 virtual void ShowDownloadInBrowser(DownloadItemImpl* download);
84 90
85 // Assert consistent state for delgate object at various transitions. 91 // Assert consistent state for delgate object at various transitions.
86 virtual void AssertStateConsistent(DownloadItemImpl* download) const; 92 virtual void AssertStateConsistent(DownloadItemImpl* download) const;
87 93
88 private: 94 private:
89 // For "Outlives attached DownloadItemImpl" invariant assertion. 95 // For "Outlives attached DownloadItemImpl" invariant assertion.
90 int count_; 96 int count_;
91 97
92 DISALLOW_COPY_AND_ASSIGN(DownloadItemImplDelegate); 98 DISALLOW_COPY_AND_ASSIGN(DownloadItemImplDelegate);
93 }; 99 };
94 100
95 } // namespace content 101 } // namespace content
96 102
97 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_ 103 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_IMPL_DELEGATE_H_
OLDNEW
« no previous file with comments | « content/browser/download/download_item_impl.cc ('k') | content/browser/download/download_item_impl_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698