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

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

Issue 1781983002: [Downloads] Introduce GUIDs for downloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 // Allow objects to observe the download creation process. 133 // Allow objects to observe the download creation process.
134 virtual void AddObserver(Observer* observer) = 0; 134 virtual void AddObserver(Observer* observer) = 0;
135 135
136 // Remove a download observer from ourself. 136 // Remove a download observer from ourself.
137 virtual void RemoveObserver(Observer* observer) = 0; 137 virtual void RemoveObserver(Observer* observer) = 0;
138 138
139 // Called by the embedder, after creating the download manager, to let it know 139 // Called by the embedder, after creating the download manager, to let it know
140 // about downloads from previous runs of the browser. 140 // about downloads from previous runs of the browser.
141 virtual DownloadItem* CreateDownloadItem( 141 virtual DownloadItem* CreateDownloadItem(
142 const std::string& guid,
142 uint32_t id, 143 uint32_t id,
143 const base::FilePath& current_path, 144 const base::FilePath& current_path,
144 const base::FilePath& target_path, 145 const base::FilePath& target_path,
145 const std::vector<GURL>& url_chain, 146 const std::vector<GURL>& url_chain,
146 const GURL& referrer_url, 147 const GURL& referrer_url,
147 const std::string& mime_type, 148 const std::string& mime_type,
148 const std::string& original_mime_type, 149 const std::string& original_mime_type,
149 const base::Time& start_time, 150 const base::Time& start_time,
150 const base::Time& end_time, 151 const base::Time& end_time,
151 const std::string& etag, 152 const std::string& etag,
(...skipping 18 matching lines...) Expand all
170 171
171 virtual BrowserContext* GetBrowserContext() const = 0; 172 virtual BrowserContext* GetBrowserContext() const = 0;
172 173
173 // Checks whether downloaded files still exist. Updates state of downloads 174 // Checks whether downloaded files still exist. Updates state of downloads
174 // that refer to removed files. The check runs in the background and may 175 // that refer to removed files. The check runs in the background and may
175 // finish asynchronously after this method returns. 176 // finish asynchronously after this method returns.
176 virtual void CheckForHistoryFilesRemoval() = 0; 177 virtual void CheckForHistoryFilesRemoval() = 0;
177 178
178 // Get the download item for |id| if present, no matter what type of download 179 // Get the download item for |id| if present, no matter what type of download
179 // it is or state it's in. 180 // it is or state it's in.
181 // DEPRECATED: Don't add new callers for GetDownload(uint32_t). Instead keep
182 // track of the GUID and use GetDownloadByGuid(), or observe the DownloadItem
183 // if you need to keep track of a specific download. (http://crbug.com/593020)
180 virtual DownloadItem* GetDownload(uint32_t id) = 0; 184 virtual DownloadItem* GetDownload(uint32_t id) = 0;
185
186 // Get the download item for |guid|.
187 virtual DownloadItem* GetDownloadByGuid(const std::string& guid) = 0;
181 }; 188 };
182 189
183 } // namespace content 190 } // namespace content
184 191
185 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_ 192 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698