| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 observer_(observer) { | 346 observer_(observer) { |
| 347 } | 347 } |
| 348 | 348 |
| 349 MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { } | 349 MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { } |
| 350 | 350 |
| 351 void MessageCenterNotificationManager::ImageDownloads::StartDownloads( | 351 void MessageCenterNotificationManager::ImageDownloads::StartDownloads( |
| 352 const Notification& notification) { | 352 const Notification& notification) { |
| 353 // In case all downloads are synchronous, assume a pending download. | 353 // In case all downloads are synchronous, assume a pending download. |
| 354 AddPendingDownload(); | 354 AddPendingDownload(); |
| 355 | 355 |
| 356 // Notification primary icon. | |
| 357 StartDownloadWithImage( | |
| 358 notification, | |
| 359 ¬ification.icon(), | |
| 360 notification.icon_url(), | |
| 361 base::Bind(&message_center::MessageCenter::SetNotificationIcon, | |
| 362 base::Unretained(message_center_), | |
| 363 notification.delegate_id())); | |
| 364 | |
| 365 // Notification image. | 356 // Notification image. |
| 366 StartDownloadWithImage( | 357 StartDownloadWithImage( |
| 367 notification, | 358 notification, |
| 368 NULL, | 359 NULL, |
| 369 notification.image_url(), | 360 notification.image_url(), |
| 370 base::Bind(&message_center::MessageCenter::SetNotificationImage, | 361 base::Bind(&message_center::MessageCenter::SetNotificationImage, |
| 371 base::Unretained(message_center_), | 362 base::Unretained(message_center_), |
| 372 notification.delegate_id())); | 363 notification.delegate_id())); |
| 373 | 364 |
| 374 // Notification button icons. | 365 // Notification button icons. |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 it != registry->enabled_extensions().end(); | 531 it != registry->enabled_extensions().end(); |
| 541 ++it) { | 532 ++it) { |
| 542 if ((*it->get()).permissions_data()->HasAPIPermission( | 533 if ((*it->get()).permissions_data()->HasAPIPermission( |
| 543 extensions::APIPermission::ID::kNotificationProvider)) { | 534 extensions::APIPermission::ID::kNotificationProvider)) { |
| 544 extension_id = (*it->get()).id(); | 535 extension_id = (*it->get()).id(); |
| 545 return extension_id; | 536 return extension_id; |
| 546 } | 537 } |
| 547 } | 538 } |
| 548 return extension_id; | 539 return extension_id; |
| 549 } | 540 } |
| OLD | NEW |