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

Unified Diff: components/offline_items_collection/core/offline_item.h

Issue 2811803006: Add support for pulling icons for OfflineItems (Closed)
Patch Set: Cleaned up the CL Created 3 years, 8 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_items_collection/core/offline_item.h
diff --git a/components/offline_items_collection/core/offline_item.h b/components/offline_items_collection/core/offline_item.h
index 5c98e94cd2be1a9a577ad37c98d3ac722eeb0ad6..5a0552eb62baf54dfec056d1b21d2461b65c3fa7 100644
--- a/components/offline_items_collection/core/offline_item.h
+++ b/components/offline_items_collection/core/offline_item.h
@@ -10,6 +10,7 @@
#include "base/time/time.h"
#include "components/offline_items_collection/core/offline_item_filter.h"
#include "components/offline_items_collection/core/offline_item_state.h"
+#include "ui/gfx/image/image.h"
#include "url/gurl.h"
namespace offline_items_collection {
@@ -133,6 +134,28 @@ struct OfflineItem {
int64_t time_remaining_ms;
};
+// This struct holds any potentially expensive visuals for an OfflineItem. If
+// the front end requires the visuals it will ask for them through the
+// OfflineContentProvider interface asynchronously to give the backend time to
+// generate them if necessary.
+//
+// It is not expected that these will change. Currently the UI might cache the
+// results of this call.
+// TODO(dtrainor): If we run into a scenario where this changes, add a way for
+// an OfflineItem update to let us know about an update to the visuals.
+struct OfflineItemVisuals {
+ OfflineItemVisuals();
+ OfflineItemVisuals(const OfflineItemVisuals& other);
+
+ ~OfflineItemVisuals();
+
+ // The icon to use for displaying this item. The icon should be 64dp x 64dp.
+ // 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
+ // TODO(dtrainor): Suggest icon size based on the icon size supported by the
+ // current OS.
+ gfx::Image icon;
+};
+
} // namespace offline_items_collection
#endif // COMPONENTS_OFFLINE_ITEMS_COLLECTION_OFFLINE_ITEM_H_

Powered by Google App Engine
This is Rietveld 408576698