Chromium Code Reviews| 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" |
| 11 #include "components/offline_items_collection/core/offline_item_filter.h" | 11 #include "components/offline_items_collection/core/offline_item_filter.h" |
| 12 #include "components/offline_items_collection/core/offline_item_state.h" | 12 #include "components/offline_items_collection/core/offline_item_state.h" |
| 13 #include "ui/gfx/image/image.h" | |
| 13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 14 | 15 |
| 15 namespace offline_items_collection { | 16 namespace offline_items_collection { |
| 16 | 17 |
| 17 // An id that uniquely represents a piece of offline content. | 18 // An id that uniquely represents a piece of offline content. |
| 18 struct ContentId { | 19 struct ContentId { |
| 19 // The namespace for the offline content. This will be used to associate this | 20 // The namespace for the offline content. This will be used to associate this |
| 20 // id with a particular OfflineContentProvider. A name_space can include | 21 // id with a particular OfflineContentProvider. A name_space can include |
| 21 // any characters except ','. This is due to a serialization format | 22 // any characters except ','. This is due to a serialization format |
| 22 // limitation. | 23 // limitation. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 // indeterminate progress bar should be used. This field is not used if | 127 // indeterminate progress bar should be used. This field is not used if |
| 127 // |state| is COMPLETE. | 128 // |state| is COMPLETE. |
| 128 int percent_completed; | 129 int percent_completed; |
| 129 | 130 |
| 130 // The estimated time remaining for the download in milliseconds. -1 | 131 // The estimated time remaining for the download in milliseconds. -1 |
| 131 // represents an unknown time remaining. This field is not used if |state| is | 132 // represents an unknown time remaining. This field is not used if |state| is |
| 132 // COMPLETE. | 133 // COMPLETE. |
| 133 int64_t time_remaining_ms; | 134 int64_t time_remaining_ms; |
| 134 }; | 135 }; |
| 135 | 136 |
| 137 // This struct holds any potentially expensive visuals for an OfflineItem. If | |
| 138 // the front end requires the visuals it will ask for them through the | |
| 139 // OfflineContentProvider interface asynchronously to give the backend time to | |
| 140 // generate them if necessary. | |
| 141 // | |
| 142 // It is not expected that these will change. Currently the UI might cache the | |
| 143 // results of this call. | |
| 144 // TODO(dtrainor): If we run into a scenario where this changes, add a way for | |
| 145 // an OfflineItem update to let us know about an update to the visuals. | |
| 146 struct OfflineItemVisuals { | |
| 147 OfflineItemVisuals(); | |
| 148 OfflineItemVisuals(const OfflineItemVisuals& other); | |
| 149 | |
| 150 ~OfflineItemVisuals(); | |
| 151 | |
| 152 // The icon to use for displaying this item. The icon should be 64dp x 64dp. | |
| 153 // Can be |nullptr| if there is no valid icon for this item. | |
|
nyquist
2017/04/13 05:08:25
Is gfx::Image a pointer?
David Trainor- moved to gerrit
2017/04/13 07:20:23
:/ crap yeah I changed it once I realized the inte
| |
| 154 // TODO(dtrainor): Suggest icon size based on the icon size supported by the | |
| 155 // current OS. | |
| 156 gfx::Image icon; | |
| 157 }; | |
| 158 | |
| 136 } // namespace offline_items_collection | 159 } // namespace offline_items_collection |
| 137 | 160 |
| 138 #endif // COMPONENTS_OFFLINE_ITEMS_COLLECTION_OFFLINE_ITEM_H_ | 161 #endif // COMPONENTS_OFFLINE_ITEMS_COLLECTION_OFFLINE_ITEM_H_ |
| OLD | NEW |