| Index: chrome/browser/ui/views/ash/balloon_view_ash.cc
|
| diff --git a/chrome/browser/ui/views/ash/balloon_view_ash.cc b/chrome/browser/ui/views/ash/balloon_view_ash.cc
|
| index 0f50a5b77c732ae7e1666c02d96a09f06f544285..ec57d60bde137cf2186da12d536731f11880e3fd 100644
|
| --- a/chrome/browser/ui/views/ash/balloon_view_ash.cc
|
| +++ b/chrome/browser/ui/views/ash/balloon_view_ash.cc
|
| @@ -166,6 +166,11 @@ void BalloonViewAsh::SetNotificationIcon(const std::string& id,
|
| GetMessageCenter()->SetNotificationPrimaryIcon(id, image);
|
| }
|
|
|
| +void BalloonViewAsh::SetNotificationImage(const std::string& id,
|
| + const gfx::ImageSkia& image) {
|
| + GetMessageCenter()->SetNotificationImage(id, image);
|
| +}
|
| +
|
| void BalloonViewAsh::DownloadImages(const Notification& notification) {
|
| // Cancel any previous downloads.
|
| downloads_.clear();
|
| @@ -180,4 +185,19 @@ void BalloonViewAsh::DownloadImages(const Notification& notification) {
|
| base::Bind(&BalloonViewAsh::SetNotificationIcon,
|
| base::Unretained(this), notification.notification_id()))));
|
| }
|
| +
|
| + // Start a download for the notification's image if appropriate.
|
| + const base::DictionaryValue* optional_fields = notification.optional_fields();
|
| + if (optional_fields &&
|
| + optional_fields->HasKey(ui::notifications::kImageUrlKey)) {
|
| + string16 url;
|
| + optional_fields->GetString(ui::notifications::kImageUrlKey, &url);
|
| + if (!url.empty()) {
|
| + downloads_.push_back(linked_ptr<ImageDownload>(new ImageDownload(
|
| + notification, GURL(url),
|
| + message_center::kNotificationPreferredImageSize,
|
| + base::Bind(&BalloonViewAsh::SetNotificationImage,
|
| + base::Unretained(this), notification.notification_id()))));
|
| + }
|
| + }
|
| }
|
|
|