| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 observer_(observer) { | 326 observer_(observer) { |
| 327 } | 327 } |
| 328 | 328 |
| 329 MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { } | 329 MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { } |
| 330 | 330 |
| 331 void MessageCenterNotificationManager::ImageDownloads::StartDownloads( | 331 void MessageCenterNotificationManager::ImageDownloads::StartDownloads( |
| 332 const Notification& notification) { | 332 const Notification& notification) { |
| 333 // In case all downloads are synchronous, assume a pending download. | 333 // In case all downloads are synchronous, assume a pending download. |
| 334 AddPendingDownload(); | 334 AddPendingDownload(); |
| 335 | 335 |
| 336 // Notification primary icon. | |
| 337 StartDownloadWithImage( | |
| 338 notification, | |
| 339 ¬ification.icon(), | |
| 340 notification.icon_url(), | |
| 341 base::Bind(&message_center::MessageCenter::SetNotificationIcon, | |
| 342 base::Unretained(message_center_), | |
| 343 notification.delegate_id())); | |
| 344 | |
| 345 // Notification image. | 336 // Notification image. |
| 346 StartDownloadWithImage( | 337 StartDownloadWithImage( |
| 347 notification, | 338 notification, |
| 348 NULL, | 339 NULL, |
| 349 notification.image_url(), | 340 notification.image_url(), |
| 350 base::Bind(&message_center::MessageCenter::SetNotificationImage, | 341 base::Bind(&message_center::MessageCenter::SetNotificationImage, |
| 351 base::Unretained(message_center_), | 342 base::Unretained(message_center_), |
| 352 notification.delegate_id())); | 343 notification.delegate_id())); |
| 353 | 344 |
| 354 // Notification button icons. | 345 // Notification button icons. |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 it != registry->enabled_extensions().end(); | 511 it != registry->enabled_extensions().end(); |
| 521 ++it) { | 512 ++it) { |
| 522 if ((*it->get()).permissions_data()->HasAPIPermission( | 513 if ((*it->get()).permissions_data()->HasAPIPermission( |
| 523 extensions::APIPermission::ID::kNotificationProvider)) { | 514 extensions::APIPermission::ID::kNotificationProvider)) { |
| 524 extension_id = (*it->get()).id(); | 515 extension_id = (*it->get()).id(); |
| 525 return extension_id; | 516 return extension_id; |
| 526 } | 517 } |
| 527 } | 518 } |
| 528 return extension_id; | 519 return extension_id; |
| 529 } | 520 } |
| OLD | NEW |