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

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

Issue 16994004: Remove DownloadItem::Is*() in favor of DI::GetState() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@di-getstate-2
Patch Set: Rebased to fix new test, applied suggestions from bauerb and benjhayden Created 7 years, 6 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
« no previous file with comments | « content/browser/download/save_package.cc ('k') | content/public/test/mock_download_item.h » ('j') | 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) 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 // Each download is represented by a DownloadItem, and all DownloadItems 5 // Each download is represented by a DownloadItem, and all DownloadItems
6 // are owned by the DownloadManager which maintains a global list of all 6 // are owned by the DownloadManager which maintains a global list of all
7 // downloads. DownloadItems are created when a user initiates a download, 7 // downloads. DownloadItems are created when a user initiates a download,
8 // and exist for the duration of the browser life time. 8 // and exist for the duration of the browser life time.
9 // 9 //
10 // Download observers: 10 // Download observers:
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // Returns true if the download can be resumed. A download can be resumed if 168 // Returns true if the download can be resumed. A download can be resumed if
169 // an in-progress download was paused or if an interrupted download requires 169 // an in-progress download was paused or if an interrupted download requires
170 // user-interaction to resume. 170 // user-interaction to resume.
171 virtual bool CanResume() const = 0; 171 virtual bool CanResume() const = 0;
172 172
173 // Returns true if the download is in a terminal state. This includes 173 // Returns true if the download is in a terminal state. This includes
174 // completed downloads, cancelled downloads, and interrupted downloads that 174 // completed downloads, cancelled downloads, and interrupted downloads that
175 // can't be resumed. 175 // can't be resumed.
176 virtual bool IsDone() const = 0; 176 virtual bool IsDone() const = 0;
177 177
178 // Convenience routines for accessing GetState() results conceptually -----
179
180 // Returns true if the download is still receiving data.
181 virtual bool IsInProgress() const = 0;
182
183 // Returns true if the download has been cancelled or was interrupted.
184 virtual bool IsCancelled() const = 0;
185
186 // Returns true if the download was interrupted.
187 virtual bool IsInterrupted() const = 0;
188
189 // Returns true if we have all the data and know the final file name.
190 virtual bool IsComplete() const = 0;
191
192 // Origin State accessors ------------------------------------------------- 178 // Origin State accessors -------------------------------------------------
193 179
194 virtual const GURL& GetURL() const = 0; 180 virtual const GURL& GetURL() const = 0;
195 virtual const std::vector<GURL>& GetUrlChain() const = 0; 181 virtual const std::vector<GURL>& GetUrlChain() const = 0;
196 virtual const GURL& GetOriginalUrl() const = 0; 182 virtual const GURL& GetOriginalUrl() const = 0;
197 virtual const GURL& GetReferrerUrl() const = 0; 183 virtual const GURL& GetReferrerUrl() const = 0;
198 virtual std::string GetSuggestedFilename() const = 0; 184 virtual std::string GetSuggestedFilename() const = 0;
199 virtual std::string GetContentDisposition() const = 0; 185 virtual std::string GetContentDisposition() const = 0;
200 virtual std::string GetMimeType() const = 0; 186 virtual std::string GetMimeType() const = 0;
201 virtual std::string GetOriginalMimeType() const = 0; 187 virtual std::string GetOriginalMimeType() const = 0;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 // return |name|. Has no effect on the final target filename. 315 // return |name|. Has no effect on the final target filename.
330 virtual void SetDisplayName(const base::FilePath& name) = 0; 316 virtual void SetDisplayName(const base::FilePath& name) = 0;
331 317
332 // Debug/testing ------------------------------------------------------------- 318 // Debug/testing -------------------------------------------------------------
333 virtual std::string DebugString(bool verbose) const = 0; 319 virtual std::string DebugString(bool verbose) const = 0;
334 }; 320 };
335 321
336 } // namespace content 322 } // namespace content
337 323
338 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_ 324 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_ITEM_H_
OLDNEW
« no previous file with comments | « content/browser/download/save_package.cc ('k') | content/public/test/mock_download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698