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

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

Issue 722953002: downloads: add the ability to undo download removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheck Created 6 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
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_MANAGER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 void Shutdown() override; 63 void Shutdown() override;
64 void GetAllDownloads(DownloadVector* result) override; 64 void GetAllDownloads(DownloadVector* result) override;
65 void StartDownload( 65 void StartDownload(
66 scoped_ptr<DownloadCreateInfo> info, 66 scoped_ptr<DownloadCreateInfo> info,
67 scoped_ptr<ByteStreamReader> stream, 67 scoped_ptr<ByteStreamReader> stream,
68 const DownloadUrlParameters::OnStartedCallback& on_started) override; 68 const DownloadUrlParameters::OnStartedCallback& on_started) override;
69 int RemoveDownloadsBetween(base::Time remove_begin, 69 int RemoveDownloadsBetween(base::Time remove_begin,
70 base::Time remove_end) override; 70 base::Time remove_end) override;
71 int RemoveDownloads(base::Time remove_begin) override; 71 int RemoveDownloads(base::Time remove_begin) override;
72 int RemoveAllDownloads() override; 72 int RemoveAllDownloads() override;
73 void ReviveDownload(uint32 id) override;
74 void FinalizeRemoval(uint32 id) override;
73 void DownloadUrl(scoped_ptr<DownloadUrlParameters> params) override; 75 void DownloadUrl(scoped_ptr<DownloadUrlParameters> params) override;
74 void AddObserver(Observer* observer) override; 76 void AddObserver(Observer* observer) override;
75 void RemoveObserver(Observer* observer) override; 77 void RemoveObserver(Observer* observer) override;
76 content::DownloadItem* CreateDownloadItem( 78 content::DownloadItem* CreateDownloadItem(
77 uint32 id, 79 uint32 id,
78 const base::FilePath& current_path, 80 const base::FilePath& current_path,
79 const base::FilePath& target_path, 81 const base::FilePath& target_path,
80 const std::vector<GURL>& url_chain, 82 const std::vector<GURL>& url_chain,
81 const GURL& referrer_url, 83 const GURL& referrer_url,
82 const std::string& mime_type, 84 const std::string& mime_type,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 ObserverList<Observer> observers_; 182 ObserverList<Observer> observers_;
181 183
182 // The current active browser context. 184 // The current active browser context.
183 BrowserContext* browser_context_; 185 BrowserContext* browser_context_;
184 186
185 // Allows an embedder to control behavior. Guaranteed to outlive this object. 187 // Allows an embedder to control behavior. Guaranteed to outlive this object.
186 DownloadManagerDelegate* delegate_; 188 DownloadManagerDelegate* delegate_;
187 189
188 net::NetLog* net_log_; 190 net::NetLog* net_log_;
189 191
192 // Removed downloads; kept alive so users can undo the removal.
193 DownloadMap removed_downloads_;
194
190 base::WeakPtrFactory<DownloadManagerImpl> weak_factory_; 195 base::WeakPtrFactory<DownloadManagerImpl> weak_factory_;
191 196
192 DISALLOW_COPY_AND_ASSIGN(DownloadManagerImpl); 197 DISALLOW_COPY_AND_ASSIGN(DownloadManagerImpl);
193 }; 198 };
194 199
195 } // namespace content 200 } // namespace content
196 201
197 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_ 202 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698