| 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_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/extensions/extension_info_map.h" | 10 #include "chrome/browser/extensions/extension_info_map.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 if (optional_fields && optional_fields->HasKey(key)) { | 372 if (optional_fields && optional_fields->HasKey(key)) { |
| 373 string16 url; | 373 string16 url; |
| 374 optional_fields->GetString(key, &url); | 374 optional_fields->GetString(key, &url); |
| 375 StartDownloadWithImage(notification, NULL, GURL(url), size, callback); | 375 StartDownloadWithImage(notification, NULL, GURL(url), size, callback); |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| 379 void MessageCenterNotificationManager::ImageDownloads::DownloadComplete( | 379 void MessageCenterNotificationManager::ImageDownloads::DownloadComplete( |
| 380 const SetImageCallback& callback, | 380 const SetImageCallback& callback, |
| 381 int download_id, | 381 int download_id, |
| 382 int http_status_code, |
| 382 const GURL& image_url, | 383 const GURL& image_url, |
| 383 int requested_size, | 384 int requested_size, |
| 384 const std::vector<SkBitmap>& bitmaps) { | 385 const std::vector<SkBitmap>& bitmaps) { |
| 385 PendingDownloadCompleted(); | 386 PendingDownloadCompleted(); |
| 386 | 387 |
| 387 if (bitmaps.empty()) | 388 if (bitmaps.empty()) |
| 388 return; | 389 return; |
| 389 gfx::Image image = gfx::Image::CreateFrom1xBitmap(bitmaps[0]); | 390 gfx::Image image = gfx::Image::CreateFrom1xBitmap(bitmaps[0]); |
| 390 callback.Run(image); | 391 callback.Run(image); |
| 391 } | 392 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 480 |
| 480 MessageCenterNotificationManager::ProfileNotification* | 481 MessageCenterNotificationManager::ProfileNotification* |
| 481 MessageCenterNotificationManager::FindProfileNotification( | 482 MessageCenterNotificationManager::FindProfileNotification( |
| 482 const std::string& id) const { | 483 const std::string& id) const { |
| 483 NotificationMap::const_iterator iter = profile_notifications_.find(id); | 484 NotificationMap::const_iterator iter = profile_notifications_.find(id); |
| 484 if (iter == profile_notifications_.end()) | 485 if (iter == profile_notifications_.end()) |
| 485 return NULL; | 486 return NULL; |
| 486 | 487 |
| 487 return (*iter).second; | 488 return (*iter).second; |
| 488 } | 489 } |
| OLD | NEW |