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

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

Issue 10915180: Make DownloadHistory observe manager, items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r168573 Created 8 years, 1 month 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
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 // The DownloadManager object manages the process of downloading, including 5 // The DownloadManager object manages the process of downloading, including
6 // updates to the history system and providing the information for displaying 6 // updates to the history system and providing the information for displaying
7 // the downloads view in the Destinations tab. There is one DownloadManager per 7 // the downloads view in the Destinations tab. There is one DownloadManager per
8 // active browser context in Chrome. 8 // active browser context in Chrome.
9 // 9 //
10 // Download observers: 10 // Download observers:
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 virtual void DownloadUrl(scoped_ptr<DownloadUrlParameters> parameters) = 0; 133 virtual void DownloadUrl(scoped_ptr<DownloadUrlParameters> parameters) = 0;
134 134
135 // Allow objects to observe the download creation process. 135 // Allow objects to observe the download creation process.
136 virtual void AddObserver(Observer* observer) = 0; 136 virtual void AddObserver(Observer* observer) = 0;
137 137
138 // Remove a download observer from ourself. 138 // Remove a download observer from ourself.
139 virtual void RemoveObserver(Observer* observer) = 0; 139 virtual void RemoveObserver(Observer* observer) = 0;
140 140
141 // Called by the embedder, after creating the download manager, to let it know 141 // Called by the embedder, after creating the download manager, to let it know
142 // about downloads from previous runs of the browser. 142 // about downloads from previous runs of the browser.
143 virtual void OnPersistentStoreQueryComplete( 143 virtual DownloadItem* CreateDownloadItem(
144 std::vector<DownloadPersistentStoreInfo>* entries) = 0; 144 const FilePath& path,
145 145 const GURL& url,
146 // Called by the embedder, in response to 146 const GURL& referrer_url,
147 // DownloadManagerDelegate::AddItemToPersistentStore. 147 const base::Time& start_time,
148 virtual void OnItemAddedToPersistentStore(int32 download_id, 148 const base::Time& end_time,
149 int64 db_handle) = 0; 149 int64 received_bytes,
150 int64 total_bytes,
151 DownloadItem::DownloadState state,
152 bool opened) = 0;
150 153
151 // The number of in progress (including paused) downloads. 154 // The number of in progress (including paused) downloads.
152 virtual int InProgressCount() const = 0; 155 virtual int InProgressCount() const = 0;
153 156
154 virtual BrowserContext* GetBrowserContext() const = 0; 157 virtual BrowserContext* GetBrowserContext() const = 0;
155 158
156 // Checks whether downloaded files still exist. Updates state of downloads 159 // Checks whether downloaded files still exist. Updates state of downloads
157 // that refer to removed files. The check runs in the background and may 160 // that refer to removed files. The check runs in the background and may
158 // finish asynchronously after this method returns. 161 // finish asynchronously after this method returns.
159 virtual void CheckForHistoryFilesRemoval() = 0; 162 virtual void CheckForHistoryFilesRemoval() = 0;
160 163
161 // Get the download item for |id| if present, no matter what type of download 164 // Get the download item for |id| if present, no matter what type of download
162 // it is or state it's in. 165 // it is or state it's in.
163 virtual DownloadItem* GetDownload(int id) = 0; 166 virtual DownloadItem* GetDownload(int id) = 0;
164 167
165 // Called when Save Page download is done.
166 virtual void SavePageDownloadFinished(DownloadItem* download) = 0;
167
168 protected: 168 protected:
169 virtual ~DownloadManager() {} 169 virtual ~DownloadManager() {}
170 170
171 private: 171 private:
172 friend class base::RefCountedThreadSafe<DownloadManager>; 172 friend class base::RefCountedThreadSafe<DownloadManager>;
173 }; 173 };
174 174
175 } // namespace content 175 } // namespace content
176 176
177 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ 177 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698