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

Unified Diff: components/offline_pages/core/downloads/download_ui_item.h

Issue 2631933002: Adding status info to DownloadUIItem and piping it through. (Closed)
Patch Set: fix comment Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/core/downloads/download_ui_item.h
diff --git a/components/offline_pages/core/downloads/download_ui_item.h b/components/offline_pages/core/downloads/download_ui_item.h
index aea7cf5ccebb9b8e8dc8d698d049b4c4051117f6..e2694c4aea3256e6b0037b571097d8aedb92c64d 100644
--- a/components/offline_pages/core/downloads/download_ui_item.h
+++ b/components/offline_pages/core/downloads/download_ui_item.h
@@ -18,20 +18,30 @@ namespace offline_pages {
struct OfflinePageItem;
class SavePageRequest;
+// The abstract "download item" that may be a media file, a web page (together
+// with all the resources) or a PWA web package. This is a data bag that exposes
+// only bits potentially visible by the user, not the internal data.
struct DownloadUIItem {
public:
+ // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.components.offlinepages.downloads
+ enum DownloadState { PENDING = 0, IN_PROGRESS = 1, PAUSED = 2, COMPLETE = 3 };
+
DownloadUIItem();
explicit DownloadUIItem(const OfflinePageItem& page);
explicit DownloadUIItem(const SavePageRequest& request);
DownloadUIItem(const DownloadUIItem& other);
~DownloadUIItem();
- // Unique id.
+ // Unique ID.
std::string guid;
// The URL of the captured page.
GURL url;
+ DownloadState download_state;
+
+ int64_t download_progress_bytes;
+
// The Title of the captured page, if any. It can be empty string either
// because the page is not yet fully loaded, or because it doesn't have any.
base::string16 title;

Powered by Google App Engine
This is Rietveld 408576698