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

Side by Side Diff: chrome/browser/notifications/message_center_notification_manager.cc

Issue 12945007: Fix Notifications Icon loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/notifications/message_center_notification_manager.h" 5 #include "chrome/browser/notifications/message_center_notification_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 content::WebContents* contents = 302 content::WebContents* contents =
303 content::WebContents::FromRenderViewHost(host); 303 content::WebContents::FromRenderViewHost(host);
304 if (!contents) { 304 if (!contents) {
305 LOG(WARNING) << "Notification needs an image but has no WebContents"; 305 LOG(WARNING) << "Notification needs an image but has no WebContents";
306 return; 306 return;
307 } 307 }
308 308
309 contents->DownloadFavicon( 309 contents->DownloadFavicon(
310 url, 310 url,
311 false,
311 size, 312 size,
312 base::Bind( 313 base::Bind(
313 &MessageCenterNotificationManager::ImageDownloads::DownloadComplete, 314 &MessageCenterNotificationManager::ImageDownloads::DownloadComplete,
314 AsWeakPtr(), 315 AsWeakPtr(),
315 callback)); 316 callback));
316 } 317 }
317 318
318 void MessageCenterNotificationManager::ImageDownloads::StartDownloadByKey( 319 void MessageCenterNotificationManager::ImageDownloads::StartDownloadByKey(
319 const Notification& notification, 320 const Notification& notification,
320 const char* key, 321 const char* key,
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 404
404 MessageCenterNotificationManager::ProfileNotification* 405 MessageCenterNotificationManager::ProfileNotification*
405 MessageCenterNotificationManager::FindProfileNotification( 406 MessageCenterNotificationManager::FindProfileNotification(
406 const std::string& id) const { 407 const std::string& id) const {
407 NotificationMap::const_iterator iter = profile_notifications_.find(id); 408 NotificationMap::const_iterator iter = profile_notifications_.find(id);
408 // If the notification is shown in UI, it must be in the map. 409 // If the notification is shown in UI, it must be in the map.
409 DCHECK(iter != profile_notifications_.end()); 410 DCHECK(iter != profile_notifications_.end());
410 DCHECK((*iter).second); 411 DCHECK((*iter).second);
411 return (*iter).second; 412 return (*iter).second;
412 } 413 }
OLDNEW
« no previous file with comments | « chrome/browser/favicon/favicon_tab_helper.cc ('k') | chrome/browser/ui/ash/launcher/launcher_favicon_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698