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

Unified Diff: chrome/browser/download/notification/download_notification_item.h

Issue 1159363002: [Download Notification] Show preview if downloaded file is image (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/browser/download/notification/download_notification_item.h
diff --git a/chrome/browser/download/notification/download_notification_item.h b/chrome/browser/download/notification/download_notification_item.h
index 76fb48b9e5a7e4c9d8b96d5f6850b98f4ec504be..225c176f7634b99ddc0c47defd9b95ae9ed6166f 100644
--- a/chrome/browser/download/notification/download_notification_item.h
+++ b/chrome/browser/download/notification/download_notification_item.h
@@ -86,7 +86,12 @@ class DownloadNotificationItem : public content::DownloadItem::Observer {
void CloseNotificationByUser();
void CloseNotificationByNonUser();
void UpdateNotificationData(NotificationUpdateType type);
- void SetNotificationImage(int resource_id);
+
+ // Set icon of the notification.
+ void SetNotificationIcon(int resource_id);
+
+ // Set preview image of the notification. Must be called on IO thread.
+ void SetNotificationImage(gfx::Image image);
NotificationUIManager* notification_ui_manager() const;
@@ -115,6 +120,11 @@ class DownloadNotificationItem : public content::DownloadItem::Observer {
scoped_ptr<std::vector<DownloadCommands::Command>> button_actions_;
Delegate* const delegate_;
+ // Whether the preview image been has set or not.
+ bool set_image_ = false;
+
+ base::WeakPtrFactory<DownloadNotificationItem> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadNotificationItem);
};

Powered by Google App Engine
This is Rietveld 408576698