| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/ash/balloon_view_ash.h" | 5 #include "chrome/browser/ui/views/ash/balloon_view_ash.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/web_notification/web_notification_tray.h" | 8 #include "ash/system/web_notification/web_notification_tray.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 return; | 82 return; |
| 83 } | 83 } |
| 84 | 84 |
| 85 content::WebContents* contents = | 85 content::WebContents* contents = |
| 86 content::WebContents::FromRenderViewHost(host); | 86 content::WebContents::FromRenderViewHost(host); |
| 87 if (!contents) { | 87 if (!contents) { |
| 88 LOG(WARNING) << "Notification needs an image but has no WebContents"; | 88 LOG(WARNING) << "Notification needs an image but has no WebContents"; |
| 89 return; | 89 return; |
| 90 } | 90 } |
| 91 | 91 |
| 92 contents->DownloadFavicon(url_, size_, base::Bind(&ImageDownload::Downloaded, | 92 contents->DownloadImage(url_, size_, base::Bind(&ImageDownload::Downloaded, |
| 93 AsWeakPtr())); | 93 AsWeakPtr())); |
| 94 } | 94 } |
| 95 | 95 |
| 96 | 96 |
| 97 BalloonViewAsh::ImageDownload::~ImageDownload() { | 97 BalloonViewAsh::ImageDownload::~ImageDownload() { |
| 98 } | 98 } |
| 99 | 99 |
| 100 void BalloonViewAsh::ImageDownload::Downloaded( | 100 void BalloonViewAsh::ImageDownload::Downloaded( |
| 101 int download_id, | 101 int download_id, |
| 102 const GURL& image_url, | 102 const GURL& image_url, |
| 103 int requested_size, | 103 int requested_size, |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 message_center::kNotificationButtonIconSize, | 225 message_center::kNotificationButtonIconSize, |
| 226 base::Bind(&BalloonViewAsh::SetNotificationButtonIcon, | 226 base::Bind(&BalloonViewAsh::SetNotificationButtonIcon, |
| 227 base::Unretained(this), | 227 base::Unretained(this), |
| 228 notification.notification_id(), | 228 notification.notification_id(), |
| 229 i)))); | 229 i)))); |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 } | 234 } |
| OLD | NEW |