OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "chrome/browser/download/notification/download_item_notification.h" | 5 #include "chrome/browser/download/notification/download_item_notification.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 gfx::Image(), // icon | 185 gfx::Image(), // icon |
186 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, | 186 message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, |
187 kDownloadNotificationNotifierId), | 187 kDownloadNotificationNotifierId), |
188 base::string16(), // display_source | 188 base::string16(), // display_source |
189 GURL(kDownloadNotificationOrigin), // origin_url | 189 GURL(kDownloadNotificationOrigin), // origin_url |
190 base::UintToString(item_->GetId()), // tag | 190 base::UintToString(item_->GetId()), // tag |
191 message_center::RichNotificationData(), watcher())); | 191 message_center::RichNotificationData(), watcher())); |
192 | 192 |
193 notification_->set_progress(0); | 193 notification_->set_progress(0); |
194 notification_->set_never_timeout(false); | 194 notification_->set_never_timeout(false); |
195 notification_->set_draw_icon_background(false); | |
196 | 195 |
197 Update(); | 196 Update(); |
198 } | 197 } |
199 | 198 |
200 DownloadItemNotification::~DownloadItemNotification() { | 199 DownloadItemNotification::~DownloadItemNotification() { |
201 if (image_decode_status_ == IN_PROGRESS) | 200 if (image_decode_status_ == IN_PROGRESS) |
202 ImageDecoder::Cancel(this); | 201 ImageDecoder::Cancel(this); |
203 } | 202 } |
204 | 203 |
205 bool DownloadItemNotification::HasNotificationClickedListener() { | 204 bool DownloadItemNotification::HasNotificationClickedListener() { |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 const std::string notification_id_in_message_center = notification->id(); | 934 const std::string notification_id_in_message_center = notification->id(); |
936 | 935 |
937 message_center::NotificationList::Notifications visible_notifications = | 936 message_center::NotificationList::Notifications visible_notifications = |
938 message_center_->GetVisibleNotifications(); | 937 message_center_->GetVisibleNotifications(); |
939 for (const auto& notification : visible_notifications) { | 938 for (const auto& notification : visible_notifications) { |
940 if (notification->id() == notification_id_in_message_center) | 939 if (notification->id() == notification_id_in_message_center) |
941 return true; | 940 return true; |
942 } | 941 } |
943 return false; | 942 return false; |
944 } | 943 } |
OLD | NEW |