| 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 #ifndef COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_OFFLINE_ITEM_H_ | 5 #ifndef COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_OFFLINE_ITEM_H_ |
| 6 #define COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_OFFLINE_ITEM_H_ | 6 #define COMPONENTS_OFFLINE_ITEMS_COLLECTION_CORE_OFFLINE_ITEM_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 std::string title; | 63 std::string title; |
| 64 | 64 |
| 65 // The description of the OfflineItem to display in the UI (may or may not be | 65 // The description of the OfflineItem to display in the UI (may or may not be |
| 66 // displayed depending on the specific UI component). | 66 // displayed depending on the specific UI component). |
| 67 std::string description; | 67 std::string description; |
| 68 | 68 |
| 69 // The type of offline item this is. This can be used for filtering offline | 69 // The type of offline item this is. This can be used for filtering offline |
| 70 // items as well as for determining which default icon to use. | 70 // items as well as for determining which default icon to use. |
| 71 OfflineItemFilter filter; | 71 OfflineItemFilter filter; |
| 72 | 72 |
| 73 // Whether or not this item is transient. Transient items won't show up in |
| 74 // persistent UI spaces and will only show up as notifications. |
| 75 bool is_transient; |
| 76 |
| 73 // TODO(dtrainor): Build out custom per-item icon support. | 77 // TODO(dtrainor): Build out custom per-item icon support. |
| 74 | 78 |
| 75 // Content Metadata. | 79 // Content Metadata. |
| 76 // --------------------------------------------------------------------------- | 80 // --------------------------------------------------------------------------- |
| 77 // The total size of the offline item as best known at the current time. | 81 // The total size of the offline item as best known at the current time. |
| 78 int64_t total_size_bytes; | 82 int64_t total_size_bytes; |
| 79 | 83 |
| 80 // Whether or not this item has been removed externally (not by Chrome). | 84 // Whether or not this item has been removed externally (not by Chrome). |
| 81 bool externally_removed; | 85 bool externally_removed; |
| 82 | 86 |
| 83 // The time when the underlying offline content was created. | 87 // The time when the underlying offline content was created. |
| 84 base::Time creation_time; | 88 base::Time creation_time; |
| 85 | 89 |
| 86 // The last time the underlying offline content was accessed. | 90 // The last time the underlying offline content was accessed. |
| 87 base::Time last_accessed_time; | 91 base::Time last_accessed_time; |
| 88 | 92 |
| 93 // Whether or not this item can be opened after it is done being downloaded. |
| 94 bool is_openable; |
| 95 |
| 89 // Request Metadata. | 96 // Request Metadata. |
| 90 // --------------------------------------------------------------------------- | 97 // --------------------------------------------------------------------------- |
| 91 // The URL of the top level frame at the time the content was offlined. | 98 // The URL of the top level frame at the time the content was offlined. |
| 92 GURL page_url; | 99 GURL page_url; |
| 93 | 100 |
| 94 // The URL that represents the original request (before any redirection). | 101 // The URL that represents the original request (before any redirection). |
| 95 GURL original_url; | 102 GURL original_url; |
| 96 | 103 |
| 97 // Whether or not this item is off the record. | 104 // Whether or not this item is off the record. |
| 98 bool is_off_the_record; | 105 bool is_off_the_record; |
| 99 | 106 |
| 100 // In Progress Metadata. | 107 // In Progress Metadata. |
| 101 // --------------------------------------------------------------------------- | 108 // --------------------------------------------------------------------------- |
| 102 // The current state of the OfflineItem. | 109 // The current state of the OfflineItem. |
| 103 OfflineItemState state; | 110 OfflineItemState state; |
| 104 | 111 |
| 105 // Whether or not the offlining of this content can be resumed if it was | 112 // Whether or not the offlining of this content can be resumed if it was |
| 106 // paused or interrupted. | 113 // paused or interrupted. |
| 107 bool is_resumable; | 114 bool is_resumable; |
| 108 | 115 |
| 116 // Whether or not this OfflineItem can be downloaded using a metered |
| 117 // connection. |
| 118 bool allow_metered; |
| 119 |
| 109 // The current amount of bytes received for this item. This field is not used | 120 // The current amount of bytes received for this item. This field is not used |
| 110 // if |state| is COMPLETE. | 121 // if |state| is COMPLETE. |
| 111 int64_t received_bytes; | 122 int64_t received_bytes; |
| 112 | 123 |
| 113 // How complete (from 0 to 100) the offlining process is for this item. -1 | 124 // How complete (from 0 to 100) the offlining process is for this item. -1 |
| 114 // represents that progress cannot be determined for this item and an | 125 // represents that progress cannot be determined for this item and an |
| 115 // indeterminate progress bar should be used. This field is not used if | 126 // indeterminate progress bar should be used. This field is not used if |
| 116 // |state| is COMPLETE. | 127 // |state| is COMPLETE. |
| 117 int percent_completed; | 128 int percent_completed; |
| 118 | 129 |
| 119 // The estimated time remaining for the download in milliseconds. -1 | 130 // The estimated time remaining for the download in milliseconds. -1 |
| 120 // represents an unknown time remaining. This field is not used if |state| is | 131 // represents an unknown time remaining. This field is not used if |state| is |
| 121 // COMPLETE. | 132 // COMPLETE. |
| 122 int64_t time_remaining_ms; | 133 int64_t time_remaining_ms; |
| 123 }; | 134 }; |
| 124 | 135 |
| 125 } // namespace offline_items_collection | 136 } // namespace offline_items_collection |
| 126 | 137 |
| 127 #endif // COMPONENTS_OFFLINE_ITEMS_COLLECTION_OFFLINE_ITEM_H_ | 138 #endif // COMPONENTS_OFFLINE_ITEMS_COLLECTION_OFFLINE_ITEM_H_ |
| OLD | NEW |