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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java

Issue 2171963002: Offline Page download bridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments from Dan Created 4 years, 5 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: chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java
new file mode 100644
index 0000000000000000000000000000000000000000..834b3fb6634b21b84bfaefcf7ca86ef25ba56c32
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadItem.java
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.offlinepages.downloads;
+
+/** Class representing offline page or save page request to downloads UI. */
+public class OfflinePageDownloadItem {
+ private final String mUrl;
+ private final String mGuid;
+ private final String mTargetPath;
+ private final long mStartTimeMs;
+ private final long mTotalBytes;
+
+ public OfflinePageDownloadItem(
+ String guid, String url, String targetPath, long startTimeMs, long totalBytes) {
+ mGuid = guid;
+ mUrl = url;
+ mTargetPath = targetPath;
+ mStartTimeMs = startTimeMs;
+ mTotalBytes = totalBytes;
+ }
+
+ /** @return GUID identifying the item. */
+ public String getGuid() {
+ return mGuid;
+ }
+
+ /** @return URL related to the item. */
+ public String getUrl() {
+ return mUrl;
+ }
+
+ /** @return Path to the offline item on the disk. */
+ // TODO(fgorski): Title would be more meaningful to show in the Download UI, where the local
+ // path is shown right now.
+ public String getTargetPath() {
+ return mTargetPath;
+ }
+
+ /** @return Start time of the item, corresponding to when the offline page was saved. */
+ public long getStartTimeMs() {
+ return mStartTimeMs;
+ }
+
+ /** @return Size of the offline archive in bytes. */
+ public long getTotalBytes() {
+ return mTotalBytes;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698