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/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_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 observer_(observer) { | 372 observer_(observer) { |
373 } | 373 } |
374 | 374 |
375 MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { } | 375 MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { } |
376 | 376 |
377 void MessageCenterNotificationManager::ImageDownloads::StartDownloads( | 377 void MessageCenterNotificationManager::ImageDownloads::StartDownloads( |
378 const Notification& notification) { | 378 const Notification& notification) { |
379 // In case all downloads are synchronous, assume a pending download. | 379 // In case all downloads are synchronous, assume a pending download. |
380 AddPendingDownload(); | 380 AddPendingDownload(); |
381 | 381 |
382 // Notification primary icon. | |
383 StartDownloadWithImage( | |
384 notification, | |
385 ¬ification.icon(), | |
386 notification.icon_url(), | |
387 base::Bind(&message_center::MessageCenter::SetNotificationIcon, | |
388 base::Unretained(message_center_), | |
389 notification.id())); | |
390 | |
391 // Notification image. | 382 // Notification image. |
392 StartDownloadWithImage( | 383 StartDownloadWithImage( |
393 notification, | 384 notification, |
394 NULL, | 385 NULL, |
395 notification.image_url(), | 386 notification.image_url(), |
396 base::Bind(&message_center::MessageCenter::SetNotificationImage, | 387 base::Bind(&message_center::MessageCenter::SetNotificationImage, |
397 base::Unretained(message_center_), | 388 base::Unretained(message_center_), |
398 notification.id())); | 389 notification.id())); |
399 | 390 |
400 // Notification button icons. | 391 // Notification button icons. |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 it != registry->enabled_extensions().end(); | 563 it != registry->enabled_extensions().end(); |
573 ++it) { | 564 ++it) { |
574 if ((*it->get()).permissions_data()->HasAPIPermission( | 565 if ((*it->get()).permissions_data()->HasAPIPermission( |
575 extensions::APIPermission::ID::kNotificationProvider)) { | 566 extensions::APIPermission::ID::kNotificationProvider)) { |
576 extension_id = (*it->get()).id(); | 567 extension_id = (*it->get()).id(); |
577 return extension_id; | 568 return extension_id; |
578 } | 569 } |
579 } | 570 } |
580 return extension_id; | 571 return extension_id; |
581 } | 572 } |
OLD | NEW |