OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 package org.chromium.components.offline_items_collection; | 5 package org.chromium.components.offline_items_collection; |
6 | 6 |
7 import org.chromium.base.annotations.SuppressFBWarnings; | 7 import org.chromium.base.annotations.SuppressFBWarnings; |
8 import org.chromium.components.offline_items_collection.OfflineItemFilter.Offlin
eItemFilterEnum; | |
9 import org.chromium.components.offline_items_collection.OfflineItemState.Offline
ItemStateEnum; | |
10 | 8 |
11 /** | 9 /** |
12 * This class is the Java counterpart to the C++ OfflineItem | 10 * This class is the Java counterpart to the C++ OfflineItem |
13 * (components/offline_items_collection/core/offline_item.h) class. | 11 * (components/offline_items_collection/core/offline_item.h) class. |
14 * | 12 * |
15 * For all member variable descriptions see the C++ class. | 13 * For all member variable descriptions see the C++ class. |
16 * TODO(dtrainor): Investigate making all class members for this and the C++ cou
nterpart const. | 14 * TODO(dtrainor): Investigate making all class members for this and the C++ cou
nterpart const. |
17 */ | 15 */ |
18 @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") | 16 @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") |
19 public class OfflineItem { | 17 public class OfflineItem { |
20 public ContentId id; | 18 public ContentId id; |
21 | 19 |
22 // Display metadata. | 20 // Display metadata. |
23 public String title; | 21 public String title; |
24 public String description; | 22 public String description; |
25 @OfflineItemFilterEnum | 23 @OfflineItemFilter |
26 public int filter; | 24 public int filter; |
27 public boolean isTransient; | 25 public boolean isTransient; |
28 | 26 |
29 // Content Metadata. | 27 // Content Metadata. |
30 public long totalSizeBytes; | 28 public long totalSizeBytes; |
31 public boolean externallyRemoved; | 29 public boolean externallyRemoved; |
32 public long creationTimeMs; | 30 public long creationTimeMs; |
33 public long lastAccessedTimeMs; | 31 public long lastAccessedTimeMs; |
34 public boolean isOpenable; | 32 public boolean isOpenable; |
35 | 33 |
36 // Request Metadata. | 34 // Request Metadata. |
37 public String pageUrl; | 35 public String pageUrl; |
38 public String originalUrl; | 36 public String originalUrl; |
39 public boolean isOffTheRecord; | 37 public boolean isOffTheRecord; |
40 | 38 |
41 // In Progress Metadata. | 39 // In Progress Metadata. |
42 @OfflineItemStateEnum | 40 @OfflineItemState |
43 public int state; | 41 public int state; |
44 public boolean isResumable; | 42 public boolean isResumable; |
45 public boolean allowMetered; | 43 public boolean allowMetered; |
46 public long receivedBytes; | 44 public long receivedBytes; |
47 public int percentCompleted; | 45 public int percentCompleted; |
48 public long timeRemainingMs; | 46 public long timeRemainingMs; |
49 | 47 |
50 OfflineItem() { | 48 OfflineItem() { |
51 id = new ContentId(); | 49 id = new ContentId(); |
52 filter = OfflineItemFilter.FILTER_OTHER; | 50 filter = OfflineItemFilter.FILTER_OTHER; |
53 state = OfflineItemState.COMPLETE; | 51 state = OfflineItemState.COMPLETE; |
54 } | 52 } |
55 } | 53 } |
OLD | NEW |