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_, | 92 contents->DownloadImage(url_, |
93 false, | 93 false, |
94 size_, | 94 size_, |
95 base::Bind(&ImageDownload::Downloaded,AsWeakPtr())); | 95 base::Bind(&ImageDownload::Downloaded,AsWeakPtr())); |
96 } | 96 } |
97 | 97 |
98 | 98 |
99 BalloonViewAsh::ImageDownload::~ImageDownload() { | 99 BalloonViewAsh::ImageDownload::~ImageDownload() { |
100 } | 100 } |
101 | 101 |
102 void BalloonViewAsh::ImageDownload::Downloaded( | 102 void BalloonViewAsh::ImageDownload::Downloaded( |
103 int download_id, | 103 int download_id, |
104 const GURL& image_url, | 104 const GURL& image_url, |
105 int requested_size, | 105 int requested_size, |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 message_center::kNotificationButtonIconSize, | 227 message_center::kNotificationButtonIconSize, |
228 base::Bind(&BalloonViewAsh::SetNotificationButtonIcon, | 228 base::Bind(&BalloonViewAsh::SetNotificationButtonIcon, |
229 base::Unretained(this), | 229 base::Unretained(this), |
230 notification.notification_id(), | 230 notification.notification_id(), |
231 i)))); | 231 i)))); |
232 } | 232 } |
233 } | 233 } |
234 } | 234 } |
235 } | 235 } |
236 } | 236 } |
OLD | NEW |